Method and apparatus for processing video signal

ABSTRACT

The present invention is related to processing a video signal. A method for decoding a video according to the present invention may comprise checking a merge coding unit which is generated by merging a plurality of coding units neighboring each other based on an encoded syntax element, and decoding the checked merge coding unit, wherein a same motion vector is shared in the merge coding unit.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a Divisional of U.S. patent application Ser. No.16/488,577 (filed on Aug. 23, 2019), which is a National Stage PatentApplication of PCT International Patent Application No.PCT/KR2018/002343 (filed on Feb. 26, 2018) under 35 U.S.C. § 371, whichclaims priority to Korean Patent Application Nos. 10-2017-0024643 (filedon Feb. 24, 2017), and 10-2017-0024644 (filed on Feb. 24, 2017), theteachings of which are incorporated herein in their entireties byreference.

TECHNICAL FIELD

The present invention relates to a method and an apparatus forprocessing video signal.

BACKGROUND ART

Recently, demands for high-resolution and high-quality images such ashigh definition (HD) images and ultra-high definition (UHD) images haveincreased in various application fields. However, higher resolution andquality image data has increasing amounts of data in comparison withconventional image data. Therefore, when transmitting image data byusing a medium such as conventional wired and wireless broadbandnetworks, or when storing image data by using a conventional storagemedium, costs of transmitting and storing increase. In order to solvethese problems occurring with an increase in resolution and quality ofimage data, high-efficiency image encoding/decoding techniques may beutilized.

Image compression technology includes various techniques, including: aninter-prediction technique of predicting a pixel value included in acurrent picture from a previous or subsequent picture of the currentpicture; an intra-prediction technique of predicting a pixel valueincluded in a current picture by using pixel information in the currentpicture; an entropy encoding technique of assigning a short code to avalue with a high appearance frequency and assigning a long code to avalue with a low appearance frequency; etc. Image data may beeffectively compressed by using such image compression technology, andmay be transmitted or stored.

In the meantime, with demands for high-resolution images, demands forstereographic image content, which is a new image service, have alsoincreased. A video compression technique for effectively providingstereographic image content with high resolution and ultra-highresolution is being discussed.

DISCLOSURE Technical Problem

An object of the present invention is to provide a method and anapparatus for multi-tree partitioning which can be used partitioning anencoding/decoding target block efficiently in encoding/decoding videosignal.

An object of the present invention is to provide a method and anapparatus for multi-tree partitioning for partitioning anencoding/decoding target block into symmetric blocks or asymmetricblocks in encoding/decoding video signal.

An object of the present invention is to provide a method and anapparatus for generating a merge coding block corresponding to a codingblock partitioned by multi-tree partitioning.

An object of the present invention is to provide a method and anapparatus for determining a representative motion vector by utilizing amotion vector precision.

An object of the present invention is to provide a recording mediumincluding a video signal bitstream encoded by various encoding methods.

The technical objects to be achieved by the present invention are notlimited to the above-mentioned technical problems. And, other technicalproblems that are not mentioned will be apparently understood to thoseskilled in the art from the following description.

Technical Solution

A method for decoding a video signal according to the present inventioncomprises checking a merge coding unit which is generated by merging aplurality of coding units neighboring each other based on an encodedsyntax element, and decoding the checked merge coding unit, wherein asame motion vector is shared in the merge coding unit.

In addition, a motion vector applied to the merge coding unit isdetermined by utilizing the encoded syntax element.

In addition, a first coding unit in a coding order among the pluralityof coding units is determined as a merge candidate coding unit, and amotion vector of the determined merge candidate coding unit is appliedas a motion vector of the merge coding unit.

In addition, the encoded syntax element comprises a first syntax element(CU_merge_flag) indicating whether there exists a merge between codingunits, and a second syntax element (CU_merge_idx) defining a shape ofthe merge coding unit when the merge is occurred by the first syntaxelement.

In addition, the second syntax element (CU_merge_idx) indicates whetherfirst two coding units in a coding order are merged or whether last twocoding units in a coding order are merged among three coding units towhich triple tree partitioning is applied.

In addition, the second syntax element (CU_merge_idx) indicates whethera first coding unit and a second coding unit in a coding order aremerged, a third coding unit and a four coding unit in a coding order aremerged, whether a first coding unit and a third coding unit in a codingorder are merged, or whether a second coding unit and a fourth codingunit in a coding order are merged among four coding units to which quadtree partitioning is applied.

In addition, partition types of a coding unit are distinguished by usingthe first syntax element (CU_merge_flag) and the second syntax element(CU_merge_idx).

In addition, a same cordword is applied to partitioning types of acoding unit distinguished by the first syntax element (CU_merge_flag)and the second syntax element (CU_merge_idx).

A method for decoding a video signal according to the present inventioncomprises determining a representative motion vector for a upper codingblock including a plurality of lower coding blocks, deriving a motionvector of a current coding block by utilizing the determinedrepresentative motion vector as a temporal motion vector candidate ofthe current coding block who refer to the upper coding block, andperforming motion compensation of the current coding block using themotion vector of the current coding block.

In addition, the representative motion vector representing the uppercoding block is determined by utilizing motion vector precisions of thelower coding blocks.

In addition, the representative motion vector representing the uppercoding block is determined to be a motion vector having a most accuratemotion vector precision among motion vectors of the lower coding blocks.

In addition, the representative motion vector representing the uppercoding block is determined to be a motion vector having a least accuratemotion vector precision among motion vectors of the lower coding blocks.

In addition, the representative motion vector representing the uppercoding block is determined based on positions of the lower codingblocks.

In addition, the representative motion vector representing the uppercoding block is determined to be a motion vector of a codding blockincluding a top left sample among the lower coding blocks.

A method for encoding a video signal according to the present inventioncomprises generating a merge coding unit by merging a plurality ofcoding units neighboring each other, encoding the generated merge codingunit, and signaling a syntax element relating to the merge coding unit,wherein a same motion vector is shared in the merge coding unit.

In addition, the signaled syntax element comprises a first syntaxelement (CU_merge_flag) indicating where there exists a merge betweencoding units, and a second syntax element (CU_merge_idx) defining ashape of the merge coding unit when the merge is occurred by the firstsyntax element.

A method for encoding a video signal according to the present inventioncomprises determining a representative motion vector for an upper codingblock including a plurality of lower coding blocks, deriving a motionvector of a current coding block by utilizing the determinedrepresentative motion vector as a temporal motion vector candidate ofthe current coding block who refer to the upper coding block, andperforming motion compensation of the current coding block using themotion vector of the current coding block.

An apparatus for decoding a video signal according to the presentinvention comprises a decoding unit to check a merge coding unitgenerated by merging a plurality of coding units neighboring each otherbased on an encoded syntax element, and decode the checked mere codingunit, wherein a same motion vector is shared in the merge coding unit.

An apparatus for decoding a video signal according to the presentinvention comprises a decoding unit to determine a representative motionvector for a upper coding block including a plurality of lower codingblocks, to derive a motion vector of a current coding block by utilizingthe determined representative motion vector as a temporal motion vectorcandidate of the current coding block who refer to the upper codingblock, and to perform motion compensation of the current coding blockusing the motion vector of the current coding block.

A recoding medium comprising a video signal bitstream, the video signalbitstream included in the recoding medium is encoded by a encodingmethod comprising generating a merge coding unit by merging a pluralityof coding units neighboring each other, encoding the generated mergecoding unit, and signaling a syntax element relating to the merge codingunit, wherein a same motion vector is shared in the merge coding unit.

A recoding medium comprising a video signal bitstream, the video signalbitstream included in the recoding medium is encoded by a encodingmethod comprising determining a representative motion vector for a uppercoding block including a plurality of lower coding blocks, deriving amotion vector of a current coding block by utilizing the determinedrepresentative motion vector as a temporal motion vector candidate ofthe current coding block who refer to the upper coding block, andperforming motion compensation of the current coding block using themotion vector of the current coding block.

The features briefly summarized above for the present invention are onlyillustrative aspects of the detailed description of the invention thatfollows, but do not limit the scope of the invention.

Advantageous Effects

According to the present invention, encoding/decoding efficiency ofvideo signal is improved by partitioning an encoding/decoding targetblock efficiently.

According to the present invention, encoding/decoding efficiency ofvideo signal is enhanced by partitioning an encoding/decoding targetblock into symmetric or asymmetric blocks.

According to the present invention, encoding/decoding efficiency ofvideo signal partitioned by multi-tree partitioning is enhanced bygenerating a merge coding unit.

According to the present invention, encoding/decoding efficiency ofvideo signal is enhanced since a motion vector can be expressed byvarious precisions and a representative motion vector can be determinedby utilizing them.

The effects obtainable by the present invention are not limited to theabove-mentioned effects, and other effects not mentioned can be clearlyunderstood by those skilled in the art from the description below.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating a device for encoding a videoaccording to an embodiment of the present invention.

FIG. 2 is a block diagram illustrating a device for decoding a videoaccording to an embodiment of the present invention.

FIGS. 3A and 3B are diagrams illustrating a partition mode that can beapplied to a coding block

FIGS. 4A to 4C are diagrams illustrating a partition type in which aquad tree and a binary tree partitioning are allowed according to anembodiment of the present invention.

FIG. 5 illustrates an example in which a coding block is hierarchicallydivided based on quad tree partitioning and binary tree partitioning,according to an embodiment to which the present invention is applied.

FIGS. 6A to 6C illustrates an example in which a coding block ishierarchically divided based on quad tree partitioning and symmetricbinary tree partitioning, according to an embodiment to which thepresent invention is applied.

FIG. 7 is a diagram illustrating a partition type in which an asymmetricbinary tree partitioning is allowed as an embodiment to which thepresent invention is applied.

FIGS. 8A to 8C illustrates a partition type of a coding block based onquad tree and symmetric/asymmetric binary tree partitioning as anembodiment to which the present invention is applied.

FIG. 9 is a flowchart illustrating a coding block partitioning methodbased on quad tree and binary tree partitioning according to anembodiment to which the present invention is applied.

FIG. 10 illustrates, as an embodiment to which the present invention isapplied, a syntax element included in a network abstract layer (NAL) towhich quadtree and binary tree partitioning are applied.

FIGS. 11A to 11K are diagrams illustrating a partition type in which anasymmetric quad tree partitioning is allowed as another embodiment towhich the present invention is applied.

FIG. 12 is a flowchart illustrating a coding block partitioning methodbased on asymmetric quad tree partitioning as another embodiment towhich the present invention is applied.

FIG. 13 illustrates a syntax element included in a network abstractlayer (NAL) to which asymmetric quadtree partitioning is applied, asanother embodiment to which the present invention is applied.

FIGS. 14A to 14C are diagrams illustrating a partition type allowingquad tree and triple tree partitioning are allowed as another embodimentto which the present invention is applied.

FIG. 15 is a flowchart illustrating a coding block partitioning methodbased on quad tree and triple tree partitioning as another embodiment towhich the present invention is applied.

FIG. 16 illustrates, as another embodiment to which the presentinvention is applied, a syntax element included in a network abstractlayer (NAL) to which quad tree and triple tree partitioning are applied.

FIGS. 17A to 17I are diagrams illustrating a partition type in whichmulti-tree partitioning is allowed according to another embodiment ofthe present invention.

FIGS. 18A to 18L are diagrams illustrating an extended partition type inwhich multi-tree partitioning is allowed as another embodiment to whichthe present invention is applied.

FIG. 19 is a flowchart illustrating coding block partitioning methodbased on multi-tree partitioning as another embodiment to which thepresent invention is applied.

FIG. 20 is a flowchart illustrating a method of generating andencoding/decoding a merge coding unit as an embodiment to which thepresent invention is applied.

FIGS. 21, 22A and 22B illustrate examples of types of coding units toexplain a merge coding unit.

FIG. 23 is a flowchart illustrating a video encoding or decoding methodusing a value of a syntax element CuMerge_idx.

FIG. 24 is a flowchart illustrating an inter prediction method as anembodiment to which the present invention is applied.

FIG. 25 is a diagram illustrating a process of deriving motioninformation of a current block when a merge mode is applied to thecurrent block.

FIG. 26 is a diagram illustrating a process of deriving motioninformation of a current block when an advanced motion vector predictor(AMVP) mode is applied to the current block.

FIGS. 27 and 28 are diagrams illustrating a motion vector derivationmethod according to a motion vector precision of a current block.

FIGS. 29 and 30 are diagrams for explaining a method of deriving atemporal motion vector (temporal MV) in a plurality of motion vectorunits.

FIG. 31 illustrates, as another embodiment to which the presentinvention is applied, a syntax element included in a network abstractlayer (NAL) applied to an intra prediction sample interpolation.

MODE FOR INVENTION

A variety of modifications may be made to the present invention andthere are various embodiments of the present invention, examples ofwhich will now be provided with reference to drawings and described indetail. However, the present invention is not limited thereto, and theexemplary embodiments can be construed as including all modifications,equivalents, or substitutes in a technical concept and a technical scopeof the present invention. The similar reference numerals refer to thesimilar element in described the drawings.

Terms used in the specification, ‘first’, ‘second’, etc. can be used todescribe various components, but the components are not to be construedas being limited to the terms. The terms are only used to differentiateone component from other components. For example, the ‘first’ componentmay be named the ‘second’ component without departing from the scope ofthe present invention, and the ‘second’ component may also be similarlynamed the ‘first’ component. The term ‘and/or’ includes a combination ofa plurality of items or any one of a plurality of terms.

The terms used in the present specification are merely used to describeparticular embodiments, and are not intended to limit the presentinvention. An expression used in the singular encompasses the expressionof the plural, unless it has a clearly different meaning in the context.In the present specification, it is to be understood that terms such as“including”, “having”, etc. are intended to indicate the existence ofthe features, numbers, steps, actions, elements, parts, or combinationsthereof disclosed in the specification, and are not intended to precludethe possibility that one or more other features, numbers, steps,actions, elements, parts, or combinations thereof may exist or may beadded.

In addition, a term “unit” used in the present application may bereplaced by a “block”, and thus, in the present specification, each termin a pair of “coding tree unit” and “coding tree block”, “coding unit”and “coding block”, “prediction unit” and “prediction block”, and“transform unit” and “transform block” may be interpreted to have thesame meaning.

Hereinafter, preferred embodiments of the present invention will bedescribed in detail with reference to the accompanying drawings.Hereinafter, the same constituent elements in the drawings are denotedby the same reference numerals, and a repeated description of the sameelements will be omitted.

FIG. 1 is a block diagram illustrating a device for encoding a videoaccording to an embodiment of the present invention.

Referring to FIG. 1 , the device 100 for encoding a video may include: apicture partitioning module 110, prediction modules 120 and 125, atransform module 130, a quantization module 135, a rearrangement module160, an entropy encoding module 165, an inverse quantization module 140,an inverse transform module 145, a filter module 150, and a memory 155.

The constitutional parts shown in FIG. 1 are independently shown so asto represent characteristic functions different from each other in thedevice for encoding a video. Thus, it does not mean that eachconstitutional part is constituted in a constitutional unit of separatedhardware or software. In other words, each constitutional part includeseach of enumerated constitutional parts for convenience. Thus, at leasttwo constitutional parts of each constitutional part may be combined toform one constitutional part or one constitutional part may be dividedinto a plurality of constitutional parts to perform each function. Theembodiment where each constitutional part is combined and the embodimentwhere one constitutional part is divided are also included in the scopeof the present invention, if not departing from the essence of thepresent invention.

Also, some of constituents may not be indispensable constituentsperforming essential functions of the present invention but be selectiveconstituents improving only performance thereof. The present inventionmay be implemented by including only the indispensable constitutionalparts for implementing the essence of the present invention except theconstituents used in improving performance. The structure including onlythe indispensable constituents except the selective constituents used inimproving only performance is also included in the scope of the presentinvention.

The picture partitioning module 110 may partition an input picture intoone or more processing units. Here, the processing unit may be aprediction unit (PU), a transform unit (TU), or a coding unit (CU). Thepicture partitioning module 110 may partition one picture intocombinations of multiple coding units, prediction units, and transformunits, and may encode a picture by selecting one combination of codingunits, prediction units, and transform units with a predeterminedcriterion (e.g., cost function).

For example, one picture may be partitioned into multiple coding units.A recursive tree structure, such as a quad tree structure, may be usedto partition a picture into coding units. A coding unit which ispartitioned into other coding units with one picture or a largest codingunit as a root may be partitioned with child nodes corresponding to thenumber of partitioned coding units. A coding unit which is no longerpartitioned by a predetermined limitation serves as a leaf node. Thatis, when it is assumed that only square partitioning is possible for onecoding unit, one coding unit may be partitioned into four other codingunits at most.

Hereinafter, in the embodiment of the present invention, the coding unitmay mean a unit performing encoding, or a unit performing decoding.

A prediction unit may be one of partitions partitioned into a square ora rectangular shape having the same size in a single coding unit, or aprediction unit may be one of partitions partitioned so as to have adifferent shape/size in a single coding unit.

When a prediction unit subjected to intra prediction is generated basedon a coding unit and the coding unit is not the smallest coding unit,intra prediction may be performed without partitioning the coding unitinto multiple prediction units N×N.

The prediction modules 120 and 125 may include an inter predictionmodule 120 performing inter prediction and an intra prediction module125 performing intra prediction. Whether to perform inter prediction orintra prediction for the prediction unit may be determined, and detailedinformation (e.g., an intra prediction mode, a motion vector, areference picture, etc.) according to each prediction method may bedetermined. Here, the processing unit subjected to prediction may bedifferent from the processing unit for which the prediction method anddetailed content is determined. For example, the prediction method, theprediction mode, etc. may be determined by the prediction unit, andprediction may be performed by the transform unit. A residual value(residual block) between the generated prediction block and an originalblock may be input to the transform module 130. Also, prediction modeinformation, motion vector information, etc. used for prediction may beencoded with the residual value by the entropy encoding module 165 andmay be transmitted to a device for decoding a video. When a particularencoding mode is used, it is possible to transmit to a device fordecoding video by encoding the original block as it is withoutgenerating the prediction block through the prediction modules 120 and125.

The inter prediction module 120 may predict the prediction unit based oninformation of at least one of a previous picture or a subsequentpicture of the current picture, or may predict the prediction unit basedon information of some encoded regions in the current picture, in somecases. The inter prediction module 120 may include a reference pictureinterpolation module, a motion prediction module, and a motioncompensation module.

The reference picture interpolation module may receive reference pictureinformation from the memory 155 and may generate pixel information of aninteger pixel or less then the integer pixel from the reference picture.In the case of luma pixels, an 8-tap DCT-based interpolation filterhaving different filter coefficients may be used to generate pixelinformation of an integer pixel or less than an integer pixel in unitsof a ¼ pixel. In the case of chroma signals, a 4-tap DCT-basedinterpolation filter having different filter coefficient may be used togenerate pixel information of an integer pixel or less than an integerpixel in units of a ⅛ pixel.

The motion prediction module may perform motion prediction based on thereference picture interpolated by the reference picture interpolationmodule. As methods for calculating a motion vector, various methods,such as a full search-based block matching algorithm (FBMA), a threestep search (TSS), a new three-step search algorithm (NTS), etc., may beused. The motion vector may have a motion vector value in units of a ½pixel or a ¼ pixel based on an interpolated pixel. The motion predictionmodule may predict a current prediction unit by changing the motionprediction method. As motion prediction methods, various methods, suchas a skip method, a merge method, an AMVP (Advanced Motion VectorPrediction) method, an intra block copy method, etc., may be used.

The intra prediction module 125 may generate a prediction unit based onreference pixel information neighboring to a current block which ispixel information in the current picture. When the neighboring block ofthe current prediction unit is a block subjected to inter prediction andthus a reference pixel is a pixel subjected to inter prediction, thereference pixel included in the block subjected to inter prediction maybe replaced with reference pixel information of a neighboring blocksubjected to intra prediction. That is, when a reference pixel is notavailable, at least one reference pixel of available reference pixelsmay be used instead of unavailable reference pixel information.

Prediction modes in intra prediction may include a directionalprediction mode using reference pixel information depending on aprediction direction and a non-directional prediction mode not usingdirectional information in performing prediction. A mode for predictingluma information may be different from a mode for predicting chromainformation, and in order to predict the chroma information, intraprediction mode information used to predict luma information orpredicted luma signal information may be utilized.

In performing intra prediction, when the size of the prediction unit isthe same as the size of the transform unit, intra prediction may beperformed on the prediction unit based on pixels positioned at the left,the top left, and the top of the prediction unit. However, in performingintra prediction, when the size of the prediction unit is different fromthe size of the transform unit, intra prediction may be performed usinga reference pixel based on the transform unit. Also, intra predictionusing N×N partitioning may be used for only the smallest coding unit.

In the intra prediction method, a prediction block may be generatedafter applying an AIS (Adaptive Intra Smoothing) filter to a referencepixel depending on the prediction modes. The type of the AIS filterapplied to the reference pixel may vary. In order to perform the intraprediction method, an intra prediction mode of the current predictionunit may be predicted from the intra prediction mode of the predictionunit neighboring to the current prediction unit. In prediction of theprediction mode of the current prediction unit by using mode informationpredicted from the neighboring prediction unit, when the intraprediction mode of the current prediction unit is the same as the intraprediction mode of the neighboring prediction unit, informationindicating that the prediction modes of the current prediction unit andthe neighboring prediction unit are equal to each other may betransmitted using predetermined flag information. When the predictionmode of the current prediction unit is different from the predictionmode of the neighboring prediction unit, entropy encoding may beperformed to encode prediction mode information of the current block.

Also, a residual block including information on a residual value whichis a different between the prediction unit subjected to prediction andthe original block of the prediction unit may be generated based onprediction units generated by the prediction modules 120 and 125. Thegenerated residual block may be input to the transform module 130.

The transform module 130 may transform the residual block including theinformation on the residual value between the original block and theprediction unit generated by the prediction modules 120 and 125 by usinga transform method, such as discrete cosine transform (DCT), discretesine transform (DST), and KLT. Whether to apply DCT, DST, or KLT inorder to transform the residual block may be determined based on intraprediction mode information of the prediction unit used to generate theresidual block.

The quantization module 135 may quantize values transformed to afrequency domain by the transform module 130. Quantization coefficientsmay vary depending on the block or importance of a picture. The valuescalculated by the quantization module 135 may be provided to the inversequantization module 140 and the rearrangement module 160.

The rearrangement module 160 may rearrange coefficients of quantizedresidual values.

The rearrangement module 160 may change a coefficient in the form of atwo-dimensional block into a coefficient in the form of aone-dimensional vector through a coefficient scanning method. Forexample, the rearrangement module 160 may scan from a DC coefficient toa coefficient in a high frequency domain using a zigzag scanning methodso as to change the coefficients to be in the form of one-dimensionalvectors. Depending on the size of the transform unit and the intraprediction mode, vertical direction scanning where coefficients in theform of two-dimensional blocks are scanned in the column direction orhorizontal direction scanning where coefficients in the form oftwo-dimensional blocks are scanned in the row direction may be usedinstead of zigzag scanning. That is, which scanning method among zigzagscanning, vertical direction scanning, and horizontal direction scanningis used may be determined depending on the size of the transform unitand the intra prediction mode.

The entropy encoding module 165 may perform entropy encoding based onthe values calculated by the rearrangement module 160. Entropy encodingmay use various encoding methods, for example, exponential Golombcoding, context-adaptive variable length coding (CAVLC), andcontext-adaptive binary arithmetic coding (CABAC).

The entropy encoding module 165 may encode a variety of information,such as residual value coefficient information and block typeinformation of the coding unit, prediction mode information, partitionunit information, prediction unit information, transform unitinformation, motion vector information, reference frame information,block interpolation information, filtering information, etc. from therearrangement module 160 and the prediction modules 120 and 125.

The entropy encoding module 165 may entropy encode the coefficients ofthe coding unit input from the rearrangement module 160.

The inverse quantization module 140 may inversely quantize the valuesquantized by the quantization module 135 and the inverse transformmodule 145 may inversely transform the values transformed by thetransform module 130. The residual value generated by the inversequantization module 140 and the inverse transform module 145 may becombined with the prediction unit predicted by a motion estimationmodule, a motion compensation module, and the intra prediction module ofthe prediction modules 120 and 125 such that a reconstructed block canbe generated.

The filter module 150 may include at least one of a deblocking filter,an offset correction unit, and an adaptive loop filter (ALF).

The deblocking filter may remove block distortion that occurs due toboundaries between the blocks in the reconstructed picture. In order todetermine whether to perform deblocking, the pixels included in severalrows or columns in the block may be a basis of determining whether toapply the deblocking filter to the current block. When the deblockingfilter is applied to the block, a strong filter or a weak filter may beapplied depending on required deblocking filtering strength. Also, inapplying the deblocking filter, horizontal direction filtering andvertical direction filtering may be processed in parallel.

The offset correction module may correct offset with the originalpicture in units of a pixel in the picture subjected to deblocking. Inorder to perform the offset correction on a particular picture, it ispossible to use a method of applying offset in consideration of edgeinformation of each pixel or a method of partitioning pixels of apicture into the predetermined number of regions, determining a regionto be subjected to perform offset, and applying the offset to thedetermined region.

Adaptive loop filtering (ALF) may be performed based on the valueobtained by comparing the filtered reconstructed picture and theoriginal picture. The pixels included in the picture may be divided intopredetermined groups, a filter to be applied to each of the groups maybe determined, and filtering may be individually performed for eachgroup. Information on whether to apply ALF and a luma signal may betransmitted by coding units (CU). The shape and filter coefficient of afilter for ALF may vary depending on each block. Also, the filter forALF in the same shape (fixed shape) may be applied regardless ofcharacteristics of the application target block.

The memory 155 may store the reconstructed block or picture calculatedthrough the filter module 150. The stored reconstructed block or picturemay be provided to the prediction modules 120 and 125 in performinginter prediction.

FIG. 2 is a block diagram illustrating a device for decoding a videoaccording to an embodiment of the present invention.

Referring to FIG. 2 , the device 200 for decoding a video may include:an entropy decoding module 210, a rearrangement module 215, an inversequantization module 220, an inverse transform module 225, predictionmodules 230 and 235, a filter module 240, and a memory 245.

When a video bitstream is input from the device for encoding a video,the input bitstream may be decoded according to an inverse process ofthe device for encoding a video.

The entropy decoding module 210 may perform entropy decoding accordingto an inverse process of entropy encoding by the entropy encoding moduleof the device for encoding a video. For example, corresponding to themethods performed by the device for encoding a video, various methods,such as exponential Golomb coding, context-adaptive variable lengthcoding (CAVLC), and context-adaptive binary arithmetic coding (CABAC)may be applied.

The entropy decoding module 210 may decode information on intraprediction and inter prediction performed by the device for encoding avideo.

The rearrangement module 215 may perform rearrangement on the bitstreamentropy decoded by the entropy decoding module 210 based on therearrangement method used in the device for encoding a video. Therearrangement module may reconstruct and rearrange the coefficients inthe form of one-dimensional vectors to the coefficient in the form oftwo-dimensional blocks. The rearrangement module 215 may receiveinformation related to coefficient scanning performed in the device forencoding a video and may perform rearrangement via a method of inverselyscanning the coefficients based on the scanning order performed in thedevice for encoding a video.

The inverse quantization module 220 may perform inverse quantizationbased on a quantization parameter received from the device for encodinga video and the rearranged coefficients of the block.

The inverse transform module 225 may perform the inverse transform,i.e., inverse DCT, inverse DST, and inverse KLT, which is the inverseprocess of transform, i.e., DCT, DST, and KLT, performed by thetransform module on the quantization result by the device for encoding avideo. Inverse transform may be performed based on a transfer unitdetermined by the device for encoding a video. The inverse transformmodule 225 of the device for decoding a video may selectively performtransform schemes (e.g., DCT, DST, and KLT) depending on multiple piecesof information, such as the prediction method, the size of the currentblock, the prediction direction, etc.

The prediction modules 230 and 235 may generate a prediction block basedon information on prediction block generation received from the entropydecoding module 210 and previously decoded block or picture informationreceived from the memory 245.

As described above, like the operation of the device for encoding avideo, in performing intra prediction, when the size of the predictionunit is the same as the size of the transform unit, intra prediction maybe performed on the prediction unit based on the pixels positioned atthe left, the top left, and the top of the prediction unit. Inperforming intra prediction, when the size of the prediction unit isdifferent from the size of the transform unit, intra prediction may beperformed using a reference pixel based on the transform unit. Also,intra prediction using N×N partitioning may be used for only thesmallest coding unit.

The prediction modules 230 and 235 may include a prediction unitdetermination module, an inter prediction module, and an intraprediction module. The prediction unit determination module may receivea variety of information, such as prediction unit information,prediction mode information of an intra prediction method, informationon motion prediction of an inter prediction method, etc. from theentropy decoding module 210, may divide a current coding unit intoprediction units, and may determine whether inter prediction or intraprediction is performed on the prediction unit. By using informationrequired in inter prediction of the current prediction unit receivedfrom the device for encoding a video, the inter prediction module 230may perform inter prediction on the current prediction unit based oninformation of at least one of a previous picture or a subsequentpicture of the current picture including the current prediction unit.Alternatively, inter prediction may be performed based on information ofsome pre-reconstructed regions in the current picture including thecurrent prediction unit.

In order to perform inter prediction, it may be determined for thecoding unit which of a skip mode, a merge mode, an AMVP mode, and aninter block copy mode is used as the motion prediction method of theprediction unit included in the coding unit.

The intra prediction module 235 may generate a prediction block based onpixel information in the current picture. When the prediction unit is aprediction unit subjected to intra prediction, intra prediction may beperformed based on intra prediction mode information of the predictionunit received from the device for encoding a video. The intra predictionmodule 235 may include an adaptive intra smoothing (AIS) filter, areference pixel interpolation module, and a DC filter. The AIS filterperforms filtering on the reference pixel of the current block, andwhether to apply the filter may be determined depending on theprediction mode of the current prediction unit. AIS filtering may beperformed on the reference pixel of the current block by using theprediction mode of the prediction unit and AIS filter informationreceived from the device for encoding a video. When the prediction modeof the current block is a mode where AIS filtering is not performed, theAIS filter may not be applied.

When the prediction mode of the prediction unit is a prediction mode inwhich intra prediction is performed based on the pixel value obtained byinterpolating the reference pixel, the reference pixel interpolationmodule may interpolate the reference pixel to generate the referencepixel of an integer pixel or less than an integer pixel. When theprediction mode of the current prediction unit is a prediction mode inwhich a prediction block is generated without interpolation thereference pixel, the reference pixel may not be interpolated. The DCfilter may generate a prediction block through filtering when theprediction mode of the current block is a DC mode.

The reconstructed block or picture may be provided to the filter module240. The filter module 240 may include the deblocking filter, the offsetcorrection module, and the ALF.

Information on whether or not the deblocking filter is applied to thecorresponding block or picture and information on which of a strongfilter and a weak filter is applied when the deblocking filter isapplied may be received from the device for encoding a video. Thedeblocking filter of the device for decoding a video may receiveinformation on the deblocking filter from the device for encoding avideo, and may perform deblocking filtering on the corresponding block.

The offset correction module may perform offset correction on thereconstructed picture based on the type of offset correction and offsetvalue information applied to a picture in performing encoding.

The ALF may be applied to the coding unit based on information onwhether to apply the ALF, ALF coefficient information, etc. receivedfrom the device for encoding a video. The ALF information may beprovided as being included in a particular parameter set.

The memory 245 may store the reconstructed picture or block for use as areference picture or block, and may provide the reconstructed picture toan output module.

As described above, in the embodiment of the present invention, forconvenience of explanation, the coding unit is used as a termrepresenting a unit for encoding, but the coding unit may serve as aunit performing decoding as well as encoding.

In addition, a current block may represent a target block to beencoded/decoded. And, the current block may represent a coding treeblock (or a coding tree unit), a coding block (or a coding unit), atransform block (or a transform unit), a prediction block (or aprediction unit), or the like depending on an encoding/decoding step. Inthis specification, a term ‘unit’ may represent a basic unit forperforming a specific encoding/decoding process, and a term ‘block’ mayrepresent sample arrays of a predetermined size. If there is nodistintion between them, the terms ‘block’ and ‘unit’ may be used tohave equivalent meanings. For example, in the embodiments describedbelow, it can be understood that a coding block and a coding unit havemutually equivalent meanings.

A picture may be encoded/decoded by divided into base blocks having asquare shape or a non-square shape. At this time, the base block may bereferred to as a coding tree unit. The coding tree unit may be definedas a coding unit of the largest size allowed within a sequence or aslice. Information regarding whether the coding tree unit has a squareshape or has a non-square shape or information regarding a size of thecoding tree unit may be signaled through a sequence parameter set, apicture parameter set, or a slice header. The coding tree unit may bedivided into smaller size partitions. At this time, if it is assumedthat a depth of a partition generated by dividing the coding tree unitis 1, a depth of a partition generated by dividing the partition havingdepth 1 may be defined as 2. That is, a partition generated by dividinga partition having a depth k in the coding tree unit may be defined ashaving a depth k+1.

FIGS. 3A and 3B are diagrams illustrating a partition mode that can beapplied to a coding block when the coding block is encoded by intraprediction or inter prediction. A partition of arbitrary size generatedby dividing a coding tree unit may be defined as a coding unit. Forexample, it is illustrated in FIG. 3A a coding unit of 2N×2N size. Thecoding unit may be recursively divided or divided into base units forperforming prediction, quantization, transform, or in-loop filtering,and the like. For example, a partition of arbitrary size generated bydividing the coding unit may be defined as a coding unit, or may bedefined as a transform unit (TU) or a prediction unit (PU), which is abase unit for performing prediction, quantization, transform or in-loopfiltering and the like.

Alternatively, if a coding block is determined, a prediction blockhaving the same size as the coding block or smaller than the codingblock may be determined through predictive partitioning of the codingblock. Predictive partitioning of the coding block can be performed by apartition mode (Part_mode) indicating a partition type of the codingblock. A size or shape of the prediction block may be determinedaccording to the partition mode of the coding block. The partition typeof the coding block may be determined through information specifying anyone of partition candidates. At this time, the partition candidatesavailable to the coding block may include an asymmetric partition type(for example, nL×2N, nR×2N, 2N×nU, 2N×nD) depending on a size, a shape,an encoding mode or the like of the coding block. For example, thepartition candidates available to the coding block may be determinedaccording to the encoding mode of the current block. For example, whenthe coding block is encoded by inter prediction, one of 8 partitionmodes may be applied to the coding block, as in the example shown inFIG. 3B. On the other hand, when the coding block is encoded by intraprediction, PART_2N×2N or PART_N×N among the 8 partition modes of FIG.3B may be applied to the coding block.

PART_N×N may be applied when the coding block has a minimum size. Here,the minimum size of the coding block may be pre-defined in the encoderand the decoder. Alternatively, information regarding the minimum sizeof the coding block may be signaled via the bitstream. For example, theminimum size of the coding block may be signaled through a slice header,so that the minimum size of the coding block may be defined for eachslice.

In another example, partition candidates available to a coding block maybe determined differently depending on at least one of a size or shapeof the coding block. For example, the number or type of partitioncandidates available to the coding block may be determined differentlyaccording to at least one of the size or shape of the coding block.

Alternatively, the type or number of asymmetric partition candidatesamong the partition candidates available to the coding block may belimited depending on the size or shape of the coding block. For example,the number or type of asymmetric partition candidates available to thecoding block may be differently determined according to at least one ofthe size or shape of the coding block.

In general, a prediction block may have a size from 64×64 to 4×4.However, when a coding block is encoded by inter prediction, it ispossible to prevent the prediction block from having a 4×4 size in orderto reduce a memory bandwidth when performing motion compensation.

It is also possible to recursively divide a coding block using thepartition mode. That is, the coding block may be divided according tothe partition mode indicated by a partition index, and each partitiongenerated by partitioning the coding block may be defined as a codingblock.

Hereinafter, a method of recursively partitioning a coding unit will bedescribed in more detail. For convenience of explanation, it is assumedthat a coding tree unit is also included in a category of a coding unit.That is, in a later-described embodiment, a coding unit may refer to acoding tree unit, or may refer to a coding unit that is generatedresulting from partitioning the coding tree unit. Also, when a codingblock is recursively divided, it can be understood that a ‘partition’generated by partitioning the coding block means a ‘coding block’.

A coding unit may be divided by at least one line. At this time, theline dividing the coding unit may have a predetermined angle. Here, thepredetermined angle may be a value within a range of 0-degree to360-degree. For example, a 0-degree line may mean a horizontal line, a90-degree line may mean a vertical line, and a 45-degree or 135-degreeline may mean a diagonal line.

When a coding unit is divided by a plurality of lines, all of theplurality of lines may have the same angle. Alternatively, at least oneof the plurality of lines may have an angle different from the otherlines. Alternatively, the plurality of lines dividing a coding tree unitor a coding unit may be set to have a predefined angle difference (e.g.,90-degree).

Information regarding the line dividing a coding tree unit or a codingunit may be defined as a partition mode and be encoded. Alternatively,information on the number of lines, directions, angles, positions oflines in a block, or the like may be encoded.

For convenience of explanation, it is assumed in the embodimentdescribed below that a coding tree unit or a coding unit is divided intoa plurality of coding units using at least one of a vertical line and ahorizontal line.

When it is assumed that partitioning of a coding unit is performed basedon at least one of a vertical line or a horizontal line, the number ofvertical lines or horizontal lines partitioning the coding unit may beone or more. For example, the coding tree unit or the coding unit may bedivided into two partitions using one vertical line or one horizontalline, or the coding unit may be divided into three partitions using twovertical lines or two horizontal lines. Alternatively, the coding unitmay be partitioned into four partitions having a length and a width of ½by using one vertical line and one horizontal line.

When a coding tree unit or a coding unit is divided into a plurality ofpartitions using at least one vertical line or at least one horizontalline, the partitions may have a uniform size. Alternatively, any onepartition may have a different size from the remaining partitions oreach partition may have a different size.

In the embodiments described below, it is assumed that dividing a codingunit into four partitions is a quad-tree based partitioning, and thatdividing a coding unit into two partitions is a binary-tree basedpartitioning. In addition, it is assumed that dividing a coding unitinto three partitions is a triple-tree based partitioning. In addition,it is assumed that a dividing scheme by applying at least two or morepartitioning scheme is a multi-tree based partitioning.

In the following drawings, it will be illustrated that a predeterminednumber of vertical lines or a predetermined number of horizontal linesare used to divide a coding unit, but it will also be within a scope ofthe present invention to divide the coding unit into more partitions orfewer partitions than shown using a greater number of vertical lines ora greater number of horizontal lines than shown.

FIGS. 4A to 4C are diagrams illustrating a partition type in which aquad tree and a binary tree partitioning are allowed according to anembodiment of the present invention.

An input video signal is decoded in predetermined block units. Such adefault unit for decoding the input video signal is a coding block. Thecoding block may be a unit performing intra/inter prediction, transform,and quantization. In addition, a prediction mode (e.g., intra predictionmode or inter prediction mode) is determined in units of a coding block,and the prediction blocks included in the coding block may share thedetermined prediction mode. The coding block may be a square ornon-square block having an arbitrary size in a range of 8×8 to 64×64, ormay be a square or non-square block having a size of 128×128, 256×256,or more.

Specifically, the coding block may be hierarchically partitioned basedon at least one of a quad tree and a binary tree. Here, quad tree-basedpartitioning may mean that a 2N×2N coding block is partitioned into fourN×N coding blocks (FIG. 4A), and binary tree-based partitioning may meanthat one coding block is partitioned into two coding blocks. Even if thebinary tree-based partitioning is performed, a square-shaped codingblock may exist in the lower depth.

Binary tree-based partitioning may be symmetrically or asymmetricallyperformed. In addition, the coding block partitioned based on the binarytree may be a square block or a non-square block, such as a rectangularshape. For example, as depicted in FIG. 4B, a partition type in whichthe binary tree-based partitioning is allowed may be a symmetric type of2N×N (horizontal directional non-square coding unit) or N×2N (verticaldirection non-square coding unit). In addition, as one example depictedin FIG. 4C, a partition type in which the binary tree-based partitioningis allowed may be an asymmetric type of nL×2N, nR×2N, 2N×nU, or 2N×nD.

Binary tree-based partitioning may be limitedly allowed to one of asymmetric or an asymmetric type partition. In this case, constructingthe coding tree unit with square blocks may correspond to quad tree CUpartitioning, and constructing the coding tree unit with symmetricnon-square blocks may correspond to binary tree CU partitioning.Constructing the coding tree unit with square blocks and symmetricnon-square blocks may correspond to quad and binary tree CUpartitioning.

Hereinafter, a partitioning scheme based on a quad-tree and abinary-tree is referred to as Quad-Tree & Binary-Tree (QTBT)partitioning.

As a result of partitioning based on quad-tree and binary-tree, a codingblock that is no longer divided may be used as a prediction block or atransform block. That is, in a quad-tree & binary-tree (QTBT)partitioning method, a coding block may become a prediction block, and aprediction block may become a transform block. For example, when theQTBT partitioning method is used, a prediction image may be generated ina unit of a coding block, and a residual signal, which is a differencebetween an original image and the prediction image, is transformed in aunit of a coding block. Here, generating the prediction image in a unitof a coding block may mean that motion information is determined basedon a coding block or an intra prediction mode is determined based on acoding block. Accordingly, a coding block may be encoded using at leastone of a skip mode, intra prediction, or inter prediction.

As another example, it is also possible to divide a coding block so asto use a prediction block or a transform block having a size smallerthan the coding block.

In a QTBT partitioning method, BT may be set to be allowed only forsymmetric partitioning. However, if only the symmetric binary tree isallowed even though an object and a background are divided at a blockboundary, an encoding efficiency may be decreased. In the presentinvention, a method of asymmetric partitioning a coding block in orderto increase an encoding efficiency will be described below as anotherembodiment. Asymmetric binary tree partitioning represents a division ofa coding block into two smaller coding blocks. As a result of theasymmetric binary tree partitioning, a coding block may be divided intotwo coding blocks of an asymmetric shape.

Binary tree-based partitioning may be performed on a coding block wherequad tree-based partitioning is no longer performed. Quad tree-basedpartitioning may no longer be performed on the coding block partitionedbased on the binary tree.

Furthermore, partitioning of a lower depth may be determined dependingon a partition type of an upper depth. For example, if binary tree-basedpartitioning is allowed in two or more depths, only the same type as thebinary tree partitioning of the upper depth may be allowed in the lowerdepth. For example, if the binary tree-based partitioning in the upperdepth is performed with 2N×N type, the binary tree-based partitioning inthe lower depth is also performed with 2N×N type. Alternatively, if thebinary tree-based partitioning in the upper depth is performed with N×2Ntype, the binary tree-based partitioning in the lower depth is alsoperformed with N×2N type.

On the contrary, it is also possible to allow, in a lower depth, only atype different from a binary tree partitioning type of an upper depth.

It may be possible to limit only a specific type of binary tree basedpartitioning to be used for sequence, slice, coding tree unit, or codingunit. As an example, only 2N×N type or N×2N type of binary tree-basedpartitioning may be allowed for the coding tree unit. An availablepartition type may be predefined in an encoder or a decoder. Orinformation on available partition type or on unavailable partition typeon may be encoded and then signaled through a bitstream.

FIG. 5 illustrates an example in which a coding block is hierarchicallydivided based on quad tree partitioning and binary tree partitioning,according to an embodiment to which the present invention is applied.

As shown in FIG. 5 , the first coding block 300 with the partition depth(split depth) of k may be partitioned into multiple second coding blocksbased on the quad tree. For example, the second coding blocks 310 to 340may be square blocks having the half width and the half height of thefirst coding block, and the partition depth of the second coding blockmay be increased to k+1.

The second coding block 310 with the partition depth of k+1 may bepartitioned into multiple third coding blocks with the partition depthof k+2. Partitioning of the second coding block 310 may be performed byselectively using one of the quad tree and the binary tree depending ona partitioning method. Here, the partitioning method may be determinedbased on at least one of the information indicating quad tree-basedpartitioning and the information indicating binary tree-basedpartitioning.

When the second coding block 310 is partitioned based on the quad tree,the second coding block 310 may be partitioned into four third codingblocks 310 a having the half width and the half height of the secondcoding block, and the partition depth of the third coding block 310 amay be increased to k+2. In contrast, when the second coding block 310is partitioned based on the binary tree, the second coding block 310 maybe partitioned into two third coding blocks. Here, each of two thirdcoding blocks may be a non-square block having one of the half width andthe half height of the second coding block, and the partition depth maybe increased to k+2. The second coding block may be determined as anon-square block of a horizontal direction or a vertical directiondepending on a partitioning direction, and the partitioning directionmay be determined based on the information on whether binary tree-basedpartitioning is performed in a vertical direction or a horizontaldirection.

In the meantime, the second coding block 310 may be determined as a leafcoding block that is no longer partitioned based on the quad tree or thebinary tree. In this case, the leaf coding block may be used as aprediction block or a transform block.

Like partitioning of the second coding block 310, the third coding block310 a may be determined as a leaf coding block, or may be furtherpartitioned based on the quad tree or the binary tree.

In the meantime, the third coding block 310 b partitioned based on thebinary tree may be further partitioned into coding blocks 310 b-2 of avertical direction or coding blocks 310 b-3 of a horizontal directionbased on the binary tree, and the partition depth of the relevant codingblocks may be increased to k+3. Alternatively, the third coding block310 b may be determined as a leaf coding block 310 b-1 that is no longerpartitioned based on the binary tree. In this case, the coding block 310b-1 may be used as a prediction block or a transform block. However, theabove partitioning process may be limitedly performed based on at leastone of the information on the size/depth of the coding block that quadtree-based partitioning is allowed, the information on the size/depth ofthe coding block that binary tree-based partitioning is allowed, and theinformation on the size/depth of the coding block that binary tree-basedpartitioning is not allowed.

A number of a candidate that represent a size of a coding block may belimited to a predetermined number, or a size of a coding block in apredetermined unit may have a fixed value. As an example, the size ofthe coding block in a sequence or in a picture may be limited to have256×256, 128×128, or 32×32. Information indicating the size of thecoding block in the sequence or in the picture may be signaled through asequence header or a picture header.

As a result of partitioning based on a quad tree and a binary tree, acoding unit may be represented as square or rectangular shape of anarbitrary size.

FIGS. 6A to 6C illustrates an example in which a coding block ishierarchically divided based on quad tree partitioning and symmetricbinary tree partitioning, according to an embodiment to which thepresent invention is applied.

FIGS. 6A to 6C illustrates an example in which only a specific type, forexample a symmetric binary tree based partitioning, is allowed. FIG. 6Ashows an example in which only binary tree based partitioning in a typeof N×2N is limitedly allowed. For example, a depth 1 coding block 601 isdivided into two N×2N blocks 601 a and 601 b in depth 2, and a depth 2coding block 602 is divisible into two N×2N blocks 602 a and 602 b indepth 3.

FIG. 6B shows an example in which only binary tree based partitioning ofa 2N×N type is limitedly allowed. For example, a depth 1 coding block603 is divided into two 2N×N blocks 603 a and 603 b in depth 2, and adepth 2 coding block 604 is divisible into two 2N×N blocks 604 a and 604b in depth 3.

FIG. 6C shows an example of partitioning a block which is generated by asymmetric binary tree partitioning. For example, a depth 1 coding block605 is divided into two N×2N blocks 605 a and 605 b in depth 2, and thedepth 2 coding block 605 a generated as a result of the division isdivided into two N×2N blocks 605 al and 605 a 2. The above describeddivisional manner is also applicable to a 2N×N coding block which isgenerated by symmetric binary tree partitioning.

In order to implement quad-tree or binary tree based adaptivepartitioning, information indicating quad-tree based partitioning,information on a size/depth of a coding block to which quad-tree basedpartitioning is allowed, information indicating binary-tree basedpartitioning, information about a size/depth of a coding block to whichbinary-tree based partitioning is allowed, information on a size/depthof a coding block to which binary-tree based partitioning is disallowed,information whether binary-tree based partitioning is performed in avertical direction or a horizontal direction, or the like may be used.For example, quad_split_flag may indicate whether a coding block isdivided into four coding blocks, and binary_split_flag may indicatewhether a coding block is divided into two coding blocks. When a codingblock is divided into two coding blocks, is_hor_split_flag indicatingwhether a partitioning direction of the coding block is a verticaldirection or a horizontal direction may be signaled.

Also, for a coding tree unit or a predetermined coding unit, the numberof times for which binary tree partitioning is allowed, a depth at whichbinary tree partitioning is allowed, or the number of the depths towhich the binary tree partitioning is allowed may be obtained. Theinformation may be encoded in a unit of a coding tree unit or a codingunit, and may be transmitted to the decoder through a bitstream.

For example, a syntax ‘max_binary_depth_idx_minus1’ indicating a maximumdepth at which binary tree partitioning is allowed may beencoded/decoded through the bitstream. In this case,max_binary_depth_idx_minus1+1 may indicate a maximum depth at whichbinary tree partitioning is allowed.

In addition, in the example of FIG. 6C described above, it isillustrated a result of binary tree partitioning relating to depth 2coding units (e.g., 605 a and 605 b) and depth 3 coding units (e.g., 605al and 605 a 2). Thus, at least one of information indicating the numberof times (e.g., twice) for which binary tree partitioning has beenperformed in the coding tree unit, information indicating a maximumdepth (e.g., depth 3) at which binary tree partitioning is allowed inthe coding tree unit, or information indicating the number of depths(e.g., 2, depth 2 and depth 3) to which binary tree partitioning isallowed may be encoded/decoded through the bitstream.

As another example, at least one of the number of times for which binarytree partitioning is allowed, a depth at which binary tree partitioningis allowed, or the number of depths to which binary tree partitioning isallowed may be obtained for each sequence or slice. For example, theinformation may be encoded in a unit of a sequence, a picture, or aslice and transmitted through the bitstream. Accordingly, a first sliceand a second slice may differ in at least one of the number of times forwhich binary tree partitioning is performed, a maximum depth at whichbinary tree partitioning is allowed, or the number of depths to whichbinary tree partitioning is allowed. For example, in the first slice,binary tree partitioning is allowed at only one depth, while in thesecond slice, binary tree partitioning is allowed at two depths.

As another example, at least one of the number of times for which binarytree partitioning is allowed, a depth at which binary tree partitioningis allowed, or the number of depths to which binary tree partitioning isallowed may be set differently according to a time level identifier(Temporal_ID) of a slice or a picture. Here, the temporal levelidentifier (Temporal_ID) is used to identify each of a plurality oflayers of a video having a scalability of at least one of view, spatial,temporal or image quality.

It is also possible to restrict use of a transform skip for a CU whichis partitioned by binary partitioning. Alternatively, a transform skipmay be applied only in at least one of a horizontal direction or avertical direction for a CU which is partitioned by non-squarepartitioning. Applying a transform skip only in a horizontal directionmay mean that only a scaling and a quantization are performed in ahorizontal direction without performing a transform in the horizontaldirection, and a transform is performed in a vertical direction byspecifying at least one transform scheme such as DCT or DST.

Likewise, applying a transform skip only in a vertical direction maymean that a transform is performed in a horizontal direction byspecifying at least one transform scheme such as DCT or DST, and only ascaling and a quantization are performed in a vertical direction withoutperforming a transform in the vertical direction. It is also possible tosignal a syntax hor_transform_skip_flag indicating whether to apply atransform skip in a horizontal direction and a syntaxver_transform_skip_flag indicating whether to apply a transform skip ina vertical direction.

When a transform skip is applied to at least one of a horizontaldirection or a vertical direction, information indicating a direction towhich the transform skip is applied may be signaled according to a shapeof a CU. Specifically, for example, for a CU of 2N×N shape, a transformis performed in a horizontal direction and a transform skip can beapplied on a vertical direction, and, for a CU of N×2N shape, atransform skip can be applied in a horizontal direction and a transformis performed on a vertical direction. Here, the transform may be atleast one of DCT or DST.

As another example, for a CU of 2N×N shape, a transform is performed ina vertical direction and a transform skip can be applied in a horizontaldirection, and, for a CU of N×2N shape, a transform skip can be appliedin a vertical direction and a transform is performed in a horizontaldirection. Here, the transform may be at least one of DCT or DST.

FIG. 7 is a diagram illustrating a partition type in which an asymmetricbinary tree partitioning is allowed as an embodiment to which thepresent invention is applied. A coding block of 2N×2N may be dividedinto two coding blocks whose width ratio is n:(1−n) or two coding blockswhose height ratio is n:(1−n). Where n may represent a real numbergreater than 0 and less than 1.

For example, it is illustrated in FIG. 7 that two coding blocks 701, 702whose width ratio is 1:3 or two coding block 703, 704 whose width ratiois 3:1, two coding blocks 705, 706 whose height ratio is 1:3, two codingblocks whose height ratio is 3:1 are generated by applying theasymmetric binary tree partitioning to a coding block.

Specifically, as a coding block of W×H size is partitioned in a verticaldirection, a left partition whose width is ¼W and a right partitionwhose width is ¾W may be generated. As described above, a partition typein which the width of the left partition is smaller than the width ofthe right partition can be referred to as nL×2N binary partition.

As a coding block of W×H size is partitioned in a vertical direction, aleft partition whose width is ¾W and a right partition whose width is ¼Wmay be generated. As described above, a partition type in which thewidth of the right partition is smaller than the width of the leftpartition can be referred to as nR×2N binary partition.

As a coding block of W×H size is partitioned in a horizontal direction,a top partition whose width is ¼H and a bottom partition whose width is¾H may be generated. As described above, a partition type in which theheight of the top partition is smaller than the height of the bottompartition can be referred to as 2N×nU binary partition.

As a coding block of W×H size is partitioned in a horizontal direction,a top partition whose width is ¾H and a bottom partition whose width is¼H may be generated. As described above, a partition type in which theheight of the bottom partition is smaller than the height of the toppartition can be referred to as 2N×nD binary partition.

In FIG. 7 , it is illustrated that a width ratio or a height ratiobetween two coding blocks is 1:3 or 3:1. However, the width ratio or theheight ratio between two coding blocks generated by asymmetric binarytree partitioning is not limited thereto. The coding block may bepartitioned into two coding blocks having different width ratio ordifferent height ratio from those shown in the FIG. 7 .

When the asymmetric binary tree partitioning is used, an asymmetricbinary partition type of a coding block may be determined based oninformation signaled via a bitstream. For example, a partition type of acoding block may be determined based on information indicating apartitioning direction of the coding block and information indicatingwhether a first partition, generated by dividing the coding block, has asmaller size than a second partition.

The information indicating the partitioning direction of the codingblock may be a flag of 1 bit indicating whether the coding block ispartitioned in a vertical direction or in a horizontal direction. Forexample, hor_binary_flag may indicate whether the coding block ispartitioned in a horizontal direction. If a value of hor_binary_flag is1, it may indicate that the coding block is partitioned in thehorizontal direction and if the value of hor_binary_flag is 0, it mayindicate that the coding block is partitioned in the vertical direction.Alternatively, ver_binary_flag indicating whether or not the codingblock is partitioned in the vertical direction may be used.

The information indicating whether the first partition has a smallersize than the second partition may be a flag of 1 bit. For example,is_left_above_small_part_flag may indicate whether a size of a left ortop partition generated by dividing the coding block is smaller than aright or bottom partition. If a value of is_left_above_small_part_flagis 1, it means that the size of the left or top partition is smallerthan the right or bottom partition. If the value ofis_left_above_small_part_flag is 0, it means that the size of the leftor top partition is larger than the right or bottom partition.Alternatively, is_right_bottom_small_part_flag indicating whether thesize of the right or bottom partition is smaller than the left or toppartition may be used.

Alternatively, sizes of a first partition and a second partition may bedetermined by using information indicating a width ratio, a height ratioor an area ratio between the first partition and the second partition.

When a value of hor_binary_flag is 0 and a value ofis_left_above_small_part_flag is 1, it may represent nL×2N binarypartition, and when a value of hor_binary_flag is 0 and a value ofis_left_above_small_part_flag is 0, it may represent nR×2N binarypartition. In addition, whan a value of hor_binary_flag is 1 and a valueof is_left_above_small_part_flag is 1, it may represent 2N×nU binarypartition, and when a value of hor_binary_flag is 1 and a value ofis_left_above_small_part_flag is 0, it may represent 2N×nD binarypartition.

As another example, the asymmetric binary partition type of the codingblock may be determined by index information indicating a partition typeof the coding block. Here, the index information is information to besignaled through a bitstream, and may be encoded with a fixed length(i.e., a fixed number of bits) or may be encoded with a variable length.For example, Table 1 below shows the partition index for each asymmetricbinary partition.

TABLE 1 Asymmetric partition index Binarization nLx2N 0 0 nRx2N 1 102NxnU 2 100 2NxnD 3 111

Asymmetric binary tree partitioning may be used depending on the QTBTpartitioning method. For example, if the quadtree partitioning or thebinary tree partitioning is no longer applied to the coding block, itmay be determined whether or not to apply asymmetric binary treepartitioning to the coding block. Here, whether or not to apply theasymmetric binary tree partitioning to the coding block may bedetermined by information signaled through the bitstream. For example,the information may be a 1 bit flag ‘asymmetric_binary_tree_flag’, andbased on the flag, it may be determined whether the asymmetric binarytree partitioning is to be applied to the coding block. Alternatively,when it is determined that the coding block is partitioned into twoblocks, it may be determined whether the partition type is binary treepartitioning or asymmetric binary tree partitioning. Here, whether thepartition type of the coding block is the binary tree partitioning orthe asymmetric binary tree partitioning may be determined by informationsignaled through the bitstream. For example, the information may be a 1bit flag ‘is_asymmetric_split_flag’, and based on the flag, it may bedetermined whether the coding block is to be partitioned into asymmetric form or an asymmetric from. As another example, indexesassigned to symmetric type binary partitions and to asymmetric typebinary partitions may be different, and it may be determined based onindex information whether the coding block is to be partitioned in asymmetric type or an asymmetric type. For example, Table 2 shows anexample in which different indexes are assigned to symmetric binary typepartitions and asymmetric binary type partitions.

TABLE 2 Binary partition index Binarization 2NxN (Binary 0 0 partitionin horizontal direction) Nx2N (Binary 1 10 partition in verticaldirection) nLx2N 2 110 nRx2N 3 1110 2NxnU 4 11110 2NxnD 5 11111

A coding tree or a coding block may be divided into a plurality ofcoding blocks by quad tree partitioning, binary tree partitioning orasymmetric binary tree partitioning. For example, FIGS. 8A to 8C showsan example in which a coding block is divided into a plurality of codingblocks using QTBT and asymmetric binary tree partitioning. Referring toFIG. 9 , it can be seen that the asymmetric binary tree partitioning isperformed in depth 2 partitioning in the first drawing, depth 3partitioning in the second drawing, and depth 3 partitioning in thethird drawing, respectively. It may be restricted that a coding blockdivided by the asymmetric binary tree partitioning is no longer divided.For example, information related to a quadtree, binary tree, orasymmetric binary tree may not be encoded/decoded for a coding blockwhich is generated by the asymmetric binary tree partitioning. That is,for a coding block generated through the asymmetric binary treepartitioning, a flag indicating whether quadtree partitioning isapplied, a flag indicating whether binary tree partitioning is applied,a flag indicating whether asymmetric binary tree partitioning isapplied, a flag indicating a direction of the binary tree partitioningor the asymmetric binary tree partitioning, or index informationindicating an asymmetric binary partition, or the like may be omitted.As another example, whether or not to allow the binary tree partitioningmay be determined depending on whether the QTBT is allowed or not. Forexample, in a picture or slice in which the QTBT-based partitioningmethod is not used, it may be restricted not to use the asymmetricbinary tree partitioning.

Information indicating whether the asymmetric binary tree partitioningis allowed may be encoded and signaled in a unit of a block, a slice ora picture. Here, the information indicating whether the asymmetricbinary tree partitioning is allowed may be a flag of 1 bit. For example,if a value of is used asymmetric QTBT enabled flag is 0, it may indicatethat the asymmetric binary tree partitioning is not used. It is alsopossible that is_used_asymmetric_QTBT_enabled_Flag is set to 0 withoutsignaling thereof when the binary tree partitioning is not used in apicture or a slice.

FIGS. 8A to 8C illustrates a partition type of a coding block based onquad tree and symmetric/asymmetric binary tree partitioning as anembodiment to which the present invention is applied.

FIG. 8A shows an example in which nL×2N type asymmetric binary treebased partitioning is allowed. For example, depth 1 coding block 801 isdivided into two asymmetric nL×2N blocks 801 a and 801 b at depth 2, anddepth 2 coding block 801 b is also divided into two symmetric N×2Nblocks 801 b 1 and 801 b 2 at depth 3.

FIG. 8B shows an example in which nR×2N type asymmetric binary treebased partitioning is allowed. For example, depth 2 coding block 802 isdivided into two asymmetric nR×2N blocks 802 a and 802 b at depth 3.

FIG. 8C shows an example in which 2N×nU type asymmetric binary treebased partitioning is allowed. For example, depth 2 coding block 803 isdivided into two asymmetric 2N×nU blocks 803 a and 803 b at depth 3.

It is also possible to determine a partition type allowed in a codingblock based on a size, a shape, a partition depth, or a partition typeof the coding block. For example, at least one of partition types,partition shapes or a number of partitions allowed in a coding blockgenerated by the quad tree partitioning and in a coding block generatedby the binary tree partitioning may be different from each other.

For example, if a coding block is generated by the quadtreepartitioning, all of the quadtree partitioning, the binary treepartitioning, and the asymmetric binary tree partitioning may be allowedfor the coding block. That is, if a coding block is generated based onquad tree partitioning, all partition types shown in FIG. 10 can beapplied to the coding block. For example, a 2N×2N partition mayrepresent a case where a coding block is not further divided, N×N mayrepresent a case where a coding block is partitioned in a quad-tree, andN×2N and 2N×N may represent a case where a coding block is partitionedin a binary tree. In addition, nL×2N, nR×2N, 2N×nU, and 2N×nD mayrepresent cases where a coding block is partitioned in an asymmetricbinary tree.

On the other hand, when a coding block is generated by the binary treepartitioning, it may not be allowed to use the asymmetric binary treepartitioning for the coding block. That is, when the coding block isgenerated based on the binary tree partitioning, it may be restrictednot to apply the asymmetric partition type (nL×2N, nR×2N, 2N×nU, 2N×nD)among the partition types shown in FIG. 7 to the coding block.

FIG. 9 is a flowchart illustrating a coding block partitioning methodbased on quad tree and binary tree partitioning as an embodiment towhich the present invention is applied.

Assume that a depth k coding block is divided into a depth k+1 codingblock. First, it is determined whether quad tree partitioning is appliedto a current block at depth k S910. If quad tree partitioning isapplied, the current block is split into four blocks of a square shapeS920. On the other hand, if quad tree partitioning is not applied, it isdetermined whether binary tree partitioning is applied to the currentblock S930. If binary tree splitting is not applied, then the currentblock becomes a depth k+1 coding block without splitting. As a result ofthe determination of S930, if binary tree partitioning is applied to thecurrent block, it is checked whether either symmetric binarypartitioning or asymmetric binary partitioning is applied S940.According to the determination result of S940, a partition type appliedto the current block is determined S950. For example, the partition typeapplied to the step S950 may be any one of symmetric types in FIG. 4B,or one of the asymmetric types in FIG. 4C. The current block is dividedinto two depth k+1 coding blocks according to the partition typedetermined at S950 S960.

FIG. 10 illustrates, as an embodiment to which the present invention isapplied, a syntax element included in a network abstract layer (NAL) towhich quadtree and binary tree partitioning are applied.

A compressed image to which the present invention is applied may bepacketized in a unit of a network abstract layer (hereinafter, referredto as ‘NAL’) and transmitted through a transmission medium. However, thepresent invention is not limited to NAL, but may be applied to variousdata transmission schemes to be developed in the future. NAL unit towhich the present invention is applied, for example, may include a videoparameter set (VPS), a sequence parameter set (SPS), a picture parameterset (PPS) and at least one slice set (Slice) as shown in FIG. 10 .

For example, it is illustrated in FIG. 10 that a syntax element includedin a sequence parameter set (SPS), but it is also possible to a pictureparameter set (PPS) or a slice set (Slice) to include the syntaxelement. In addition, a syntax element to be commonly applied tosequence units or a picture unit may be included in a sequence parameterset (SPS) or a picture parameter set (PPS). On the other hand, a syntaxelement that is applied only to the slice is preferably included in aslice set (Slice). Therefore, this can be selected in consideration ofencoding performance and efficiency.

In this regard, syntax elements to which quad tree and binary treepartitioning are applied are as follows. It is possible to set allsyntax elements shown in FIG. 10 as essential elements, but it is alsopossible to selectively set some syntax elements among them as essentialelements in consideration of encoding efficiency and performance.

For example, ‘quad_split_flag’ indicates whether a coding block isdivided into four coding blocks. ‘binary_split_flag’ may indicatewhether a coding block is split into two coding blocks. When the codingblock is divided into two coding blocks, ‘is_hor_split_flag’ indicatingwhether a partitioning direction of the coding block is vertical orhorizontal may be signaled. It can be defined that it represents ahorizontal direction when “is_hor_split_flag=1”, and it represents avertical direction when “is_hor_split_flag=0”.

In another alternative, it can be represented by ‘isUseBinaryTreeFlag’whether binary tree partitioning is applied to a current block, and“hor_binary_flag” which is a syntax element representing a partitioningdirection of a coding block may represents whether the current block ispartitioned in a horizontal direction. For example, when“hor_binary_flag=1”, this may indicate that a coding block is split in ahorizontal direction, and when “hor_binary_flag=0”, it may indicate thata coding block is split in a vertical direction. Or, instead of‘hor_binary_flag’, ver_binary_flag indicating whether a coding block ispartitioned in a vertical direction may be used in the same manner.

In addition, ‘max_binary_depth_idx_minus1’ may be defined as a syntaxelement to indicate a maximum depth in which binary tree partitioning isallowed. For example, “max_binary_depth_idx_minus1+1” may indicate amaximum depth at which binary tree partitioning is allowed.

In addition, ‘ver_transform_skip_flag’ may be set as a syntax element toindicate whether to apply a transform skip in a horizontal direction,and ‘hor_transform_skip_flag’ may be set as a syntax element to indicatewhether to apply a transform skip in a vertical direction.

In addition, ‘is_used_asymmetric_QTBT_enabled_flag’ may be defined as asyntax element to indicate whether asymmetric binary tree partitioningis allowed. For example, when “is_used_asymmetric_QTBT_enabled_flag=1”,it may indicate that asymmetric binary tree partitioning is used, andwhen “is_used_asymmetric_QTBT_enabled_flag=0” it may indicate thatasymmetric binary tree partitioning is not used. On the other hand, whenbinary tree partitioning is not used in a picture unit or slice unit, avalue of is_used_asymmetric_QTBT_enabled_flag may be set to 0 withoutsignaling it. Alternatively, whether asymmetric binary tree partitioningis applied to the current block may be indicated through‘asymmetric_binary_tree_flag’.

In addition, as a syntax element indicating asymmetric binary treepartitioning, ‘is_left_above_small_part_flag’ may indicate whether asize of a left or top partition generated by partitioning a coding blockis smaller than a right or bottom partition. For example, if“is_left_above_small_part_flag=1”, it may mean a size of a left or toppartition is smaller than a right or bottom partition, and if“is_left_above_small_part_flag=0”, it may mean a size of a left or toppartition is larger than a right or bottom partition. Alternatively,instead of ‘is_left_above_small_part_flag’,‘is_right_bottom_small_part_flag’ indicating whether a size of a rightor bottom partition is smaller than a left or top partition may be used.

In this regard, it is possible to combine the syntax elements to definean asymmetric binary partition type of a coding block. For example, when“hor_binary_flag=0” and “is_left_above_small_part_flag=1”, it mayrepresent nL×2N binary partition, and when “hor_binary_flag=0” and“is_left_above_small_part_flag=0”, it may represent nR×2N binarypartition. In addition, when “hor_binary_flag=1” and“is_left_above_small_part_flag=1”, it may represent 2N×nU binarypartition, and when “hor_binary_flag=1” and“is_left_above_small_part_flag=0”, it may represent 2N×nD binarypartition. Similarly, an asymmetric binary partition type may berepresented by a combination of ‘ver_binary_flag’ and‘is_right_bottom_small_part_flag’.

In another alternative, an asymmetric binary partition type of a codingblock may be defined by indicating an index in above described Table 1by ‘Asymmetric_partition_index’ or may be defined by indicating an indexin above described Table 2 by ‘Binary_partition_index’.

As described in the above example, a coding unit (or a coding tree unit)can be recursively divided by at least one vertical or horizontal line.For example, it can be summarized that quad tree partitioning is amethod of dividing a coding block using a horizontal line and a verticalline, and a binary tree partitioning is a method of dividing a codingblock using a horizontal line or a vertical line. A partition type of acoding block based on the quad tree partitioning and the binary treepartitioning is not limited to the example shown in FIG. 4A to FIG. 8C,and an extended partition type other than the illustrated types can beused. That is, a coding block may be recursively divided in a typedifferent from that shown in FIGS. 4A to 8C.

FIGS. 11A to 11K are diagrams illustrating a partition type in which anasymmetric quad tree partitioning is allowed as another embodiment towhich the present invention is applied.

When a current block is quad tree partitioned, at least one of ahorizontal line or a vertical line may divide the coding blockasymmetrically. Here, asymmetry may mean that heights of blocks dividedby a horizontal line are not the same or widths of blocks divided by avertical line are not the same. For example, a horizontal line maydivide a coding block into asymmetrical shapes while a vertical linedivides the coding block into symmetric shapes, or a horizontal line maydivide a coding block into symmetrical shapes while a vertical linedivides the coding block into asymmetric shapes. Alternatively, both thehorizontal line and the vertical line may divide a coding blockasymmetrically.

FIG. 11A shows a symmetric partitioning type of a coding block, andFIGS. 11B to 11K show asymmetric quad tree partitioning types of acoding block. FIG. 11A shows an example in which both a horizontal lineand a vertical line are used for symmetric partitioning. FIGS. 11B and11C show examples in which a horizontal line is used for symmetricpartitioning whereas a vertical line is used for asymmetricpartitioning. FIGS. 11D and 11E show examples in which a vertical lineis used for symmetric partitioning while a horizontal line is used forasymmetric partitioning.

In order to specify a partition type of a coding block, informationrelated to the partition type of the coding block may be encoded. Here,the information may include a first indicator indicating whether apartition type of a coding block is symmetric or asymmetric. The firstindicator may be encoded in a unit of a block, or may be encoded foreach vertical line or each horizontal line. For example, the firstindicator may include information indicating whether a vertical line isto be used for symmetric partitioning and information indicating whethera horizontal line is to be used for symmetric partitioning.

Alternatively, the first indicator may be encoded only for a verticalline or a horizontal line, and a partition type of another line forwhich the first indicator is not encoded may be derived dependently bythe first indicator. For example, the partition type of another line forwhich the first indicator is not encoded may have a value opposite tothat of the first indicator. That is, if the first indicator indicatesthat a vertical line is used for asymmetric partitioning, it may be setto use a horizontal line for symmetric partitioning opposite to thefirst indicator.

It is also possible to further encode a second indicator for a verticalline or a horizontal line when the first indicator indicates asymmetricpartitioning. Here, the second indicator may indicate at least one of aposition of a vertical line or a horizontal line used for asymmetricpartitioning or a ratio between blocks divided by the vertical line orthe horizontal line.

Quad tree partitioning may be performed using a plurality of verticallines or a plurality of horizontal lines. For example, it is alsopossible to divide a coding block into four blocks by combining at leastone of one or more vertical lines or one or more horizontal lines.

FIGS. 11F to 11K are diagrams showing an example of partitioning acoding block asymmetrically by combining a plurality of verticallines/horizontal lines and one horizontal line/vertical line.

Referring to FIGS. 11F to 11K, quad tree partitioning is performed bydividing a coding block into three blocks by two vertical lines or twohorizontal lines, and then dividing one of the three divided blocks intotwo blocks. At this time, as in the example shown in FIGS. 11F to 11K, ablock located in a center among the blocks divided by two vertical linesor two horizontal lines can be divided by a horizontal line or avertical line. It is also possible to divide a block located at one sideof the coding block by using a horizontal or a vertical line.Alternatively, information (e.g., a partition index) for specifying apartition to be divided among the three partitions may be signaledthrough a bitstream.

At least one of a horizontal line or a vertical line may be used todivide a coding block asymmetrically, and the other may be used todivide the coding block symmetrically. For example, a plurality ofvertical lines or a plurality of horizontal lines may be used to dividea coding block into symmetric shapes, or one horizontal line or onevertical line may be used to divide the coding block into symmetricshapes. Alternatively, both horizontal line and vertical line may beused to divide the coding block into symmetric shapes, or may be used todivide the coding block into asymmetric shapes.

For example, FIG. 11F illustrates a partition type in which a codingblock at a middle which is generated by asymmetric partitioning usingtwo vertical lines is divided into two symmetric type coding blocks by ahorizontal line. In addition, FIG. 11G illustrates a partition type inwhich a coding block at a middle which is generated by asymmetricpartitioning using two horizontal lines is divided into two symmetrictype coding blocks by a vertical line.

On the other hand, FIGS. 11H and 11I show partition types in which acoding block at a middle which is generated by asymmetric partitioningusing two vertical lines is divided again into two asymmetric codingblocks by a horizontal line. In addition, FIGS. 11J and 11K showpartition types in which a coding block at a middle which is generatedby asymmetric partitioning using two horizontal lines is divided againinto two asymmetric coding blocks by a vertical line.

When combining a plurality of vertical lines/horizontal lines and onehorizontal line/one vertical line, the coding block can be divided intofour partitions (i.e., four coding blocks) composed of at least twodifferent sizes. A method of dividing a coding block into fourpartitions having at least two different sizes can be referred to asasymmetric quad tree partitioning of three types (Triple Type AsymmetricQuad-tree CU partitioning).

Information on the triple asymmetric quad tree partitioning may beencoded based on at least one of the first indicator or the secondindicator described above. For example, the first indicator may indicatewhether a partition type of a coding block is symmetric or asymmetric.The first indicator may be encoded in a unit of a block, or may beencoded each for a vertical line or a horizontal line. For example, thefirst indicator may include information indicating whether one or morevertical lines are to be used for symmetric partitioning and informationindicating whether one or more horizontal lines are to be used forsymmetric partitioning.

Alternatively, the first indicator may be encoded only for a verticalline or a horizontal line, and a partition type of another line forwhich the first indicator is not encoded may be derived by the firstindicator.

It is also possible to further encode the second indicator for avertical line or a horizontal line when the first indicator indicatesasymmetric partitioning. Here, the second indicator may indicate atleast one of a position of a vertical line or a horizontal line used forasymmetric partitioning or a ratio between blocks divided by a verticalline or a horizontal line.

FIG. 12 is a flowchart illustrating a coding block partitioning methodbased on asymmetric quad tree partitioning as another embodiment towhich the present invention is applied.

Assume that a depth k coding block is divided into a depth k+1 codingblock. First, it is determined whether quad tree partitioning is appliedto a current block at depth k S1210. As a result of the determination ofstep S1210, if it is determined that quad tree partitioning is notapplied, the current block becomes a depth k+1 coding block withoutsplitting. If it is determined in step S1210 that quad tree partitioningis applied, it is determined whether asymmetric quad tree partitioningis applied to the current block 51220. If asymmetric quad treepartitioning is not applied and symmetric quad tree partitioning isapplied, the current block is split into four blocks of a square shape51230.

On the other hand, if asymmetric quad tree partitioning is applied, itis determined whether asymmetric quad tree partitioning of three typesis applied to the current block 51240. If asymmetric quad treepartitioning of three types is not applied, the current block is dividedinto four asymmetric blocks in two types S1250. In this case, thecurrent block may be partitioned by any one partition types of FIGS. 11Bto 11E according to partition information.

On the other hand, if asymmetric quad tree partitioning of three typesis applied, the current block is divided into four asymmetric blocks inthree types S1260. In this case, the current block may be partitioned byany one of partition types of FIGS. 11F to 11K according to partitioninformation.

FIG. 13 illustrates a syntax element included in a network abstractlayer (NAL) to which asymmetric quadtree partitioning is applied, asanother embodiment to which the present invention is applied. The NALunit to which the present invention is applied may include, for example,a video parameter set (VPS), a sequence parameter set (SPS), a pictureparameter set (PPS), and at least one slice set (Slice).

For example, it is illustrated in FIG. 13 that a syntax element includedin a sequence parameter set (SPS), but it is also possible to a pictureparameter set (PPS) or a slice set (Slice) to include the syntaxelement. In addition, a syntax element to be commonly applied tosequence units or a picture unit may be included in a sequence parameterset (SPS) or a picture parameter set (PPS). On the other hand, a syntaxelement that is applied only to the slice is preferably included in aslice set (Slice). Therefore, this can be selected in consideration ofencoding performance and efficiency.

A syntax element ‘Is_used_asymmertic_quad_tree_flag’ indicates whetherquad tree partitioning is performed asymmetrically. In addition,‘Is_used_triple_asymmertic_quad_tree_flag’ indicates whether quad treepartitioning is performed asymmetrically with three types. Therefore,when “Is_used_asymmertic_quad_tree_flag=0”, it means that quad treepartitioning is performed symmetrically, thus,‘Is_used_triple_asymmertic_quad_tree_flag’ is not signaled. On the otherhand, when “Is_used_asymmertic_quad_tree_flag=1” and“Is_used_triple_asymmertic_quad_tree_flag=1”, it means asymmetric quadtree partitioning of three types is performed. In addition, when“Is_used_asymmertic_quad_tree_flag=1” and“Is_used_triple_asymmertic_quad_tree_flag=0”, it means asymmetric quadtree partitioning of two types is performed.

A syntax element ‘hor_asymmetric_flag’ indicates a direction ofasymmetric quad tree partitioning. That is, when“Is_used_asymmertic_quad_tree_flag=1”, it may indicate whether theasymmetric partitioning is performed in a horizontal direction or avertical direction. For example, when “hor_asymmetric_flag=1”, it mayindicate asymmetric partitioning in a horizontal direction, and when“hor_asymmetric_flag=0”, it may indicate asymmetric partitioning in avertical direction. Alternatively, it is also possible to utilize‘ver_asymmetric_flag’.

A syntax element ‘width_left_asymmetric_flag’ indicates anotherdirection of asymmetric quad tree partitioning. That is, when“Is_used_asymmertic_quad_tree_flag=1”, it may indicate whetherasymmetric partitioning is performed in a left direction or a rightdirection based on a width. For example, when“width_left_asymmetric_flag ‘=1”, it may indicate that asymmetricpartitioning is performed for a left direction based on a width, andwhen “width left_asymmetric_flag=0”, it may indicate that asymmetricpartitioning is performed for a right direction based on a width.

In addition, a syntax element ‘height_top_asymmetric_flag’ indicatesanother direction of asymmetric quad tree partitioning. That is, when“Is_used_asymmertic_quad_tree_flag=1”, it may indicate whether theasymmetric partitioning is performed in an upper direction or a lowerdirection based on a height. For example, when“height_top_asymmetric_flag=1”, it may indicate that asymmetricpartitioning is performed for an upper direction based on a height, andwhen “height_top_asymmetric_flag=0”, it may indicate that asymmetricpartitioning is performed for a lower direction based on a height.

In addition, a syntax element ‘is_used_symmetric_line_flag’ indicateswhether blocks at a middle are symmetric or not when quad treepartitioning of three types is applied. That is, when“Is_used_asymmertic_quad_tree_flag=1” and“Is_used_triple_asymmertic_quad_tree_flag=1”, it indicates that blocksat the middle are divided symmetrically.

Thus, through a combination of the syntax elements, it is possible torepresent a partition type shown in FIGS. 11A to 11K. For example, when“Is_used_asymmertic_quad_tree_flag=0”, it means that a block ispartitioned into 4 symmetric blocks as shown in a partition type of FIG.11 (a).

In addition, when “Is_used_asymmertic_quad_tree_flag=1” and“Is_used_triple_asymmertic_quad_tree_flag=0”, it may mean any one ofpartition types of FIGS. 11B to 11E. In this case, when“hor_asymmetric_flag=1” and “width_left_asymmetric_flag ‘=1”, this meansa partition type of FIG. 11B. In addition, when “hor_asymmetric_flag=1”and “width left asymmetric flag ‘=0”, it means a partition type of FIG.11C. In addition, when “hor_asymmetric_flag=0” and“height_top_asymmetric_flag ‘=1”, it means a partition type of FIG. 11D.In addition, when “hor_asymmetric_flag=0” and“height_top_asymmetric_flag’=0”, it means a partition type of FIG. 11E.

In addition, when “Is_used_asymmertic_quad_tree_flag=1” and“Is_used_triple_asymmertic_quad_tree_flag=1”, it means any one ofpartition types of FIGS. 11F to 11K. In this case, when“is_used_symmetric_line_flag=1”, it means any one of partition types ofFIGS. 11F and 11G, and when “is_used_symmetric_line_flag=0”, it meansany one of partition types of FIGS. 11H to 11K. In addition, when“is_used_symmetric_line_flag=1” and “hor_asymmetric_flag=1”, it may bedefined as a partition type of FIG. 11F, and when“hor_asymmetric_flag=0”, it may be defined as a partition type of FIG.11G.

In addition, when “Is_used_asymmertic_quad_tree_flag=1”,“Is_used_triple_asymmertic_quad_tree_flag=1” and“is_used_symmetric_line_flag=0”, a partition type may be defined by“hor_asymmetric_flag”, “width_left_asymmetric_flag”, and“height_top_asymmetric_flag”. For example, when “hor_asymmetric_flag=1”and “height_top_asymmetric_flag=0”, it means a partition type of FIG.11H. In addition, when “hor_asymmetric_flag=1” and“height_top_asymmetric_flag=1”, it means a partition type of FIG. 11I.In addition, when “hor_asymmetric_flag=0” and“width_left_asymmetric_flag=0”, it means a partition type of FIG. 11J.In addition, when “hor_asymmetric_flag=0” and“width_left_asymmetric_flag=1”, it means a partition type of FIG. 11K.

In addition, as another alternative, each partition types of FIGS. 11Ato 11K may be represented as index by ‘asymmetric quadtree partitionindex’.

FIGS. 14A to 14C are diagrams illustrating a partition type allowingquad tree and triple tree partitioning are allowed as another embodimentto which the present invention is applied.

A coding block may be hierarchically divided based on at least one of aquad tree and a triple tree. Here, quad tree based partitioning means amanner of dividing a 2N×2N coding block into four N×N coding blocks(FIG. 14A), and triple tree based partitioning means a manner ofdividing a coding block into three coding blocks. Even if triple treebased partitioning is performed, there may be a square coding block at alower depth.

Triple tree based splitting may be performed symmetrically (FIG. 14B) ormay be performed asymmetrically (FIG. 14C). In addition, a coding blockdivided based on triple tree may be a square block or a non-square blocksuch as a rectangle. For example, a partition type that allows tripletree based partitioning is 2N×(2N/3) (horizontal non-square coding unit)or (2N/3)×2N (vertical non-square coding unit) that is symmetric withthe same width or the same height as in the example shown in FIG. 14B.In addition, as an example, a partition type that allows triple treebased partitioning may be an asymmetric partition type including codingblocks having different widths or heights, as shown in the exampleillustrated in FIG. 14C. For example, in an asymmetric triple treepartition type according to FIG. 14C, at least two coding blocks 1401,1403 may be located at both sides and have the same width (or height) ofk, and the rest of a block 1402 may be located between the blocks 1401,1404 having the same size and may have a width of 2k.

In this regard, a method of dividing a CTU or a CU into threesub-partitions having a non-square shape as shown in FIGS. 14A to 14Care referred to as triple tree partitioning method (triple tree CUpartitioning). A CU divided by triple tree partitioning may berestricted from being partitioned additionally.

FIG. 15 is a flowchart illustrating a coding block partitioning methodbased on quad tree and triple tree partitioning as another embodiment towhich the present invention is applied.

Assume that a depth k coding block is divided into a depth k+1 codingblock. First, it is determined whether quad tree partitioning is appliedto a current block at depth k S1510. If quad tree partitioning isapplied, the current block is split into four square blocks S1520. Onthe other hand, if the quad tree partitioning is not been applied, it isdetermined whether triple tree partitioning is applied to the currentblock S1530. If triple tree partitioning is not applied, the currentblock becomes a depth k+1 coding block without partitioning.

As a result of the determination of S1530, if triple tree partitioningis applied to the current block, it is checked whether either ofsymmetric triple partitioning or asymmetric triple partitioning isapplied S1540. A partition type applied to the current block isdetermined according to the determination result of S1540 S1550. Forexample, a partition type applied at step S1550 may be any one of typesof FIG. 14B in the case of symmetry, or may be any one of the types ofFIG. 14C in the case of asymmetry. According to a partition typedetermined at step S1550, the current block is divided into three codingblocks at depth k+1 S1560.

FIG. 16 illustrates, as another embodiment to which the presentinvention is applied, a syntax element included in a network abstractlayer (NAL) to which quad tree and triple tree partitioning are applied.The NAL unit to which the present invention is applied may include, forexample, a video parameter set (VPS), a sequence parameter set (SPS), apicture parameter set (PPS), and at least one slice set (Slice).

For example, it is illustrated in FIG. 16 that a syntax element includedin a sequence parameter set (SPS), but it is also possible to a pictureparameter set (PPS) or a slice set (Slice) to include the syntaxelement. In addition, a syntax element to be commonly applied tosequence units or a picture unit may be included in a sequence parameterset (SPS) or a picture parameter set (PPS). On the other hand, a syntaxelement that is applied only to the slice is preferably included in aslice set (Slice). Therefore, this can be selected in consideration ofencoding performance and efficiency.

A syntax element ‘quad_split_flag’ indicates whether a coding block isdivided into four coding blocks. ‘triple_split_flag’ may indicatewhether a coding block is divided into three coding blocks. When thecoding block is divided into three coding blocks, ‘is_hor_split_flag’indicating whether a partitioning direction of the coding block isvertical or horizontal may be signaled. When “is_hor_split_flag=1”, itmay mean a horizontal direction, and when “is_hor_split_flag=0”, it maymean a vertical direction.

In addition, as another alternative, it is also possible to indicatewhether triple tree partitioning is applied to a current block through‘isUseTripleTreeFlag’, and to indicate whether a coding block ispartitioned in a horizontal direction through a syntax element of‘triple_split_flag’. For example, when “hor_triple_flag=1”, it mayindicate that a coding block is partitioned in a horizontal direction,and when “hor_triple_flag=0”, it may indicate that a coding block ispartitioned in a vertical direction. Alternatively, instead of‘hor_triple_flag’, ver_triple_flag indicating whether a coding block ispartitioned in a vertical direction may be used in the same manner.

In addition, as a syntax element indicating whether asymmetric tripletree partitioning is allowed, ‘asymmetric_triple_tree_flag’ may bedefined. For example, when “asymmetric_triple_tree_flag=1”, it indicatesthat asymmetric triple tree partitioning is used, and when“asymmetric_triple_tree_flag=0”, it indicates that asymmetric tripletree partitioning is not used. On the other hand, when triple treepartitioning is not used in a picture unit or a slice unit, a value maybe set to 0 without signaling ‘asymmetric_triple_tree_flag’.

Thus, through a combination of the syntax elements, it is possible torepresent a partition type shown in FIGS. 14A to 14C. For example, if“isUseTripleTreeFlag=0”, it means that a block is partitioned into foursymmetric blocks as shown in a partition type of FIG. 14A.

In addition, when “isUseTripleTreeFlag=1” and“asymmetric_triple_tree_flag=0”, it means any one of partition types ofFIG. 14B. In this case, when “hor_triple_flag=1”, it may means (2N/3)×2Npartition type of FIG. 14B, and when “hor_triple_flag=0”, it may mean2N×(2N/3) partition type of FIG. 14B.

In addition, when “isUseTripleTreeFlag=1” and“asymmetric_triple_tree_flag=1”, it means any one of partition types ofFIG. 14C. At this time, when “hor_triple_flag=1”, it may mean apartition type illustrated in a left side of FIG. 14C, and when“hor_triple_flag=0”, it may mean a partition type illustrated in a rightside of FIG. 14C.

In addition, as another alternative, each partition types of FIGS. 14Ato 14C may be represented as index by‘asymmetric_tripletree_partition_index’.

FIGS. 17A to 17I are diagrams illustrating a partition type in whichmulti-tree partitioning is allowed according to another embodiment ofthe present invention.

A method of partitioning a CTU or CU using at least one of theabove-described quad tree partitioning, binary partitioning, or tripletree partitioning may be referred to multi-tree partitioning (or multitree CU partitioning). A CTU or CU can be partitioned using any Npartitions among the above mentioned examples. Specifically, forexample, as shown in FIGS. 17A to 17I, a CTU or CU may be partitionedusing 9 partitioning types.

For a unit of a sequence or a picture, partitioning may be performed byusing all of quad tree partitioning, binary tree partitioning, andtriple tree partitioning or partitioning may be performed by using oneor two of quad tree partitioning, binary tree partitioning, or tripletree partitioning.

It is also possible to use quad tree partitioning as default, and to usebinary tree partitioning and triple tree partitioning selectively. Atthis time, it is possible to signal whether to use binary treepartitioning and/or triple tree partitioning through a sequenceparameter set or picture parameter set.

Alternatively, it is also possible to use quad tree partitioning andtriple tree partitioning as default, and to use binary tree partitioningselectively. For example, a syntax isUseBinaryTreeFlag indicatingwhether binary tree partition is used may be signaled in a sequenceheader. If a value of the isUseBinaryTreeFlag is 1, a CTU or CU in thecurrent sequence can be partitioned using binary tree partitioning. Itis also possible to signal a syntax isUseTripleTreeFlag indicatingwhether triple tree partitioning is used through a sequence header. If avalue of the isUseTripleTreeFlag is 1, a CTU or CU in the currentsequence header may be partitioned using triple tree partitioning.

Partition shapes partitioned by multi-tree partitioning can be limitedto 9 basic partitions shown in, for example, FIGS. 17A to 17I. FIG. 17Ashows a quad partition type, 17B to 17C show symmetric binary treepartition types, 17D to 17E show triple tree partition types and 17F to17I show asymmetric binary tree partition types. The detaileddescription relating to each partition type illustrated in FIGS. 17A to17I are omitted since they are identical to above described.

In addition, as another alternative, partition types divided bymulti-tree partitioning may be extended to further include 12 partitionsillustrated in FIGS. 18A to 18L. FIGS. 18A to 18D show an asymmetricquad tree partition types, FIGS. 18E to 18J show partition types ofasymmetric quad tree partitioning of three types, and FIGS. 18K to 18Lshow partition types of symmetric triple tree partitioning. Eachpartition type shown in FIGS. 18A to 18L are the same as describedabove, thus, a detailed description thereof will be omitted.

FIG. 19 is a flowchart illustrating coding block partitioning methodbased on multi-tree partitioning as another embodiment to which thepresent invention is applied.

Assume that a depth k coding block is divided into a depth k+1 codingblock. First, it is determined whether quad tree partitioning is appliedto a current block at depth k S1910. If the quad tree partitioning isnot applied, it is determined whether binary tree partitioning isapplied to the current block S1950. In addition, if binary treepartitioning is not applied, it is determined whether triple treepartitioning is applied to the current block S1990. As a result ofdetermination at S1950, if triple tree partitioning is not applied, thecurrent block becomes a depth k+1 coding block without partitioning.

Here, as a result of the determination of step S1910, if quad treepartitioning is applied, it is checked whether symmetric or asymmetricquadtree partitioning is performed S1920. Thereafter, partitioninformation is checked to determine a block partition type of thecurrent block S1930, and the current block is divided into four blocksaccording to the determined partition type S1940. For example, when thesymmetric quad tree is applied, the block is divided into a partitiontype of FIG. 17A. In addition, when the asymmetric quad tree is applied,the block is divided into any one of partition types of FIGS. 18A to18D. Alternatively, when asymmetric quad tree partitioning of three typeis applied, the block is divided into any one of partition types ofFIGS. 18E to 18J. However, as described above, if only a basic partitiontype of FIGS. 17A to 17I are available as a multi-tree partition type,only the symmetric square block of FIG. 17A may be applied withoutdetermining whether the quad tree is asymmetric.

In addition, as a result of the determination of step S1950, if binarytree partitioning is applied, it is checked whether symmetric orasymmetric binary tree partitioning is performed S1960. Thereafter, ablock partition type of the current block is determined by checkingpartition information S1970, and the current block is divided into twoblocks according to the determined partition type S1980. For example,when a symmetric binary tree is applied, the block is divided into anyone of partition types of FIGS. 17B and 17C. In addition, when anasymmetric binary tree is applied, the block is divided into any one ofpartition types of FIGS. 17F to 17I.

In addition, as a result of the determination of step S1990, if tripletree partitioning is applied, it is checked whether symmetric orasymmetric triple tree partitioning is performed S1960. Thereafter, ablock partition type of the current block is determined by checkingpartition information S1970, and the current block is divided into threeblocks according to the determined partition type S1980. For example,when an asymmetric triple tree is applied, the block is divided into anyone of partition types of FIGS. 17D and 17E. In addition, when asymmetric binary tree is applied, the block is divided into any ofpartition types of FIGS. 18K to 18L. However, as described above, ifonly a basic partition type of FIGS. 17A to 17I are available for themulti-tree partition type, only the pre-defined asymmetric triple blockin FIGS. 17D and 17E can be applied without determining whether thetriple tree is asymmetric.

As a syntax element representing multi-tree partitioning,‘is_used_Multitree_flag’ indicating whether multi-tree partitioning isperformed may be defined. In addition, it is possible to use the syntaxelements shown and described with reference to FIGS. 10, 13, and 16 asinformation for determining a multi-tree partition type.

For example, a merge coding unit may be generated by merging a pluralityof neighboring coding units. At this time, any one of the plurality ofcoding units will be referred to as a merge candidate coding unit. Themerge candidate coding unit may mean a coding unit that have a first ina scanning order among the plurality of coding units. Or, it may mean acoding unit located in a specific direction among the plurality ofcoding units. The specific direction may mean the leftmost, topmost orcenter position.

Referring to FIG. 21 , it is illustrated 9 types of CUs to which theabove-described multi-tree partitioning is applied, and each CU may bereferred to as CU_2N×2N, CU_N×2N, CU_2N×N, CU nL×2N×nR, CU_nU×2N×nD,CU_nL×2N, CU_nR×2N, CU_2N×nU and CU_2N×nD, respectively. In this regard,partition types including at least three partitioned coding units amongthe 9 types of CUs, for example, CU_2N×2N, CU_nL×2N×nR, and CU_nU×2N×nD,may be selected as merge target coding units. On the other hands, asanother alternatively, partition types including at least n (n≥2) codingunits among the types of CUs may be selected as the merge target codingunits.

Next, referring to FIG. 20 , a merge coding unit is generated using themerge candidate coding unit S2020.

For example, for a CU_nL×2N×nR generated by the triple tree partitioningdescribed above, any one of three coding units CU0, CU1, and CU2vertically neighboring thereto may be a merge candidate coding unit. Inthis regard, FIG. 22A illustrates a process of generation of two typesof merge coding units from a CU_nL×2N×nR coding unit. A merge codingunit (merged CU) may be generated by merging CU0 and CU1 among three ofCU0, CU1 and CU2 of which constituting the CU_nL×2N×nR or by merging CU1and CU2.

Meanwhile, information specifying a coding unit to be merged may besignaled. The information may be encoded in a form of a flag or indexrelating to a location of the coding unit to be merged. For example, thesyntax element CuMerge_idx may be defined as follows to distinguish themerged coding unit (merged CU). That is, when the syntax elementCuMerge_idx value is ‘0’, it is defined that first two coding units in acoding order among partitioned coding units are merged. And when thesyntax element CuMerge_idx value is ‘1’, it is defined that last twocoding units in a coding order are merged.

In addition, for example, for a CU_nU×2N×nD generated by the triple treepartitioning described above, any one of three coding units (CU3, CU4,CU5) horizontally neighboring thereto may be a merge candidate codingunit. In this regard, FIG. 22B illustrates a process of generation oftwo types of merge coding unit from a CU_nU×2N×nD coding unit. A mergecoding unit (merged CU) is generated by merging CU3 and CU4 among threeof CU3, CU4, and CU5 of which constituting the CU_nU×2N×nD, or bymerging CU4 and CU5. In addition, as described above, to distinguish amerged CU to be generated, a value of a syntax element CuMerge_idx maybe set to 0 when first two coding units in a coding order amongpartitioned coding units are merged, and a value of a syntax elementCuMerge_idx may be set to 1 when last two coding units in a coding orderare merged.

Finally, referring to FIG. 20 , encoding or decoding is performed on thegenerated merge coding unit S2030. For example, a merge candidate codingunit coding parameter, motion data, and/or texture data may be used inthe encoding/decoding process (i.e., a prediction, a transform, aquantization, etc.) of the merge coding unit. For example, a motionvector, a reference picture index, an intra mode, an intra referencesample, etc. of the merge candidate coding unit may be used as a motionvector, a reference picture index, an intra mode, an intra referencesample, etc. of the merge coding unit.

FIG. 23 is a flowchart illustrating a video encoding or decoding methodusing a value of a syntax element CuMerge_idx.

First, it is checked whether a current coding block is divided intothree coding units by triple tree partitioning S2200. If it is dividedinto three coding units, a value of CuMerge_idx is checked S2210. When“CuMerge_idx=0”, a merged coding unit is generated by merging first twocoding units in a coding order for coding blocks S2220. On the otherhand, when “CuMerge_idx=1”, a merged coding unit is generated by merginglast two coding units in a coding order for coding blocks S2230.

However, the present invention is not limited to the example shown inFIG. 23 . That is, for example, in the case of 4 CUs divided by quadtree partitioning, a merge coding unit (merged CU) may be distinguishedby additionally defining values of CuMerge_idx. For example, when“CuMerge_idx=0”, it may be defined that first two coding units in acoding order are merged, when “CuMerge_idx=1”, it may be defined thatfirst and third coding units in the coding order are merged, and when“CuMerge_idx=2”, it may be defined that second and fourth coding unitsin the coding order are merged.

Tables 3 and 4 show syntax elements that determine a type of a codingunit to which multi-tree partitioning (quad tree partitioning, binarypartitioning, and triple tree partitioning) is applied, as shown in FIG.21 .

In addition to the syntax element CuMerge_idx, another syntax elementCU_merge_flag may be signaled. If a value of Cu_merge_flag is ‘1’, itindicates that a neighboring coding block and a current coding block aremerged. Here, the merge may mean a process of generating a new type ofcoding unit by merging a plurality of coding units. Alternatively, itmay be regarded as a process of re-determining a partition type bymerging some of a plurality of coding units partitioned by multi-treepartitioning.

Accordingly, by using the syntax elements CuMerge_idx and CU_merge_flag,partition types of coding blocks by multi-tree partitioning may bedistinguished and defined. For example, the following description willbe given in detail with the codewords shown in Table 3 or Table 4 below.

First, a triple tree partitioned coding unit CU_nL×2N×nR and CU_nU×2N×nDcan be re-generated into coding units of CU_nL×2N, CU_nR×2N, CU_2N×nU orCU_2N×nD by applying the merge coding unit scheme as shown in FIGS. 22Aand 22B. In a more general sense, non-square vertical direction binarytree partitioning can be made by using the coding unit merge scheme fromvertical direction triple tree partitioning (e.g., FIG. 22A). Inaddition, non-square horizontal direction binary tree partitioning canbe made by using the coding unit merge scheme from horizontal directiontriple tree partitioning (e.g., FIG. 22B).

That is, coding units CU_nL×2N, CU_nR×2N, CU_2N×nU, and CU_2N×nD havethe same shape as the coding units generated by applying the mergescheme to the coding unit CU_nL×2N×nR or CU_nU×2N×nD. Therefore, it ispossible to distinguish the coding units by using CU_merge_flagindicating whether it is merged and CuMerge_idx indicating a merge typeor direction.

For example, referring to Tables 3 and 4, codewords of CU_nL×2N andCU_nR×2N coding units (e.g., Table 3-‘0001’ and Table 4-‘001’) are setto the same as a codeword of CU_nL×2N×nR (e.g., Table 3-‘0001’ and Table4-‘001’), and are distinguished by the above-described CuMerge_idx andCu_merge_flag values. Similarly, codewords of CU_2N×nU and CU_2N×nDcoding units (e.g., Table 3-‘0000’, Table 4-‘000’) are set to the sameas a codeword of CU_nU×2N×nD (e.g., Table 3-‘0000’, Table 4-’ ofCU_nU×2N×nD. 000’), but they are distinguished by the above-describedCuMerge_idx and Cu_merge_flag values. Therefore, encoding and decodingefficiency can be increased by utilize codewords efficiently.

TABLE 3 Partitioning CU index partitioning Codeword CU_merge_flagCuMerge_idx 0 CU_2Nx2N 1 — — 1 CU_Nx2N 01 — — 2 CU_2NxN 001 — — 3CU_nLx2NxnR 0001 0 — 4 CU_nUx2NxnD 0000 0 — 5 CU_nLx2N 0001 1 1 6CU_nRx2N 0001 1 0 7 CU_2NxnU 0000 1 1 8 CU_2NxnD 0000 1 0

TABLE 4 Partitioning CU Index partitioning Codeword CU_merge_flagCuMerge_idx 0 CU_2Nx2N 1 — — 1 CU_Nx2N 011 — — 2 CU_2NxN 010 — — 3CU_nLx2NxnR 001 0 — 4 CU_nUx2NxnD 000 0 — 5 CU_nLx2N 001 1 1 6 CU_nRx2N001 1 0 7 CU_2NxnU 000 1 1 8 CU_2NxnD 000 1 0

FIG. 24 is a flowchart illustrating an inter prediction method as anembodiment to which the present invention is applied. Steps ofdetermining motion information of a current block S2410, and performingmotion compensation of the current block by using the determined motioninformation S2420 are included in FIG. 24 . Hereinafter, the steps willbe described in detail.

First, referring to FIG. 24 , motion information of the current blockmay be determined S2410. The motion information of the current block mayinclude at least one of a motion vector of the current block, areference picture index of the current block, or an inter predictiondirection of the current block.

The motion information of the current block may be obtained based on atleast one of information signaled through a bitstream or motioninformation of a neighboring block adjacent to the current block.

In this regard, FIG. 25 is a diagram illustrating a process of derivingmotion information of a current block when a merge mode is applied tothe current block. On the other hand, FIG. 26 is a diagram illustratinga process of deriving motion information of a current block when anadvanced motion vector predictor (AMVP) mode is applied to the currentblock.

First, a case in which a merge mode is applied to a current block willbe described with reference to FIG. 25 . A spatial merge candidate maybe derived from a spatial neighboring block of the current block S2510.The spatial neighboring block may include at least one of a blockadjacent to a top, left, or corner (e.g., at least one of a top leftcorner, a top right corner, or a bottom left corner) of the currentblock.

Motion information of the spatial merge candidate may be set to be thesame as motion information of the spatial neighboring block.

A temporal merge candidate may be derived from a temporal neighboringblock of the current block S2520. The temporal neighboring block maymean a co-located block included in a collocated picture. The collocatedpicture has a temporal order (Picture Order Count, POC) different fromthe current picture including the current block. A picture having apredefined index in a reference picture list may be determined as thecollocated picture, or the collocated picture is determined by an indexsignaled through the bitstream. A block included in a block having thesame position and size as the current block in the collocated picture ora block adjacent to a block having the same position and size as thecurrent block in the collocated picture may be determined as thetemporal neighboring block. For example, at least one of a blockincluding a center coordinate of a block having the same position andsize as the current block in the collocated picture, or a block adjacentto a right bottom boundary of the block may be determined as thetemporal neighboring block.

Motion information of the temporal merge candidate may be determinedbased on motion information of the temporal neighboring block. Forexample, a motion vector of the temporal merge candidate may bedetermined based on a motion vector of the temporal neighboring block.In addition, an inter prediction direction of the temporal mergecandidate may be set to be the same as an inter prediction direction ofthe temporal neighboring block. However, a reference picture index ofthe temporal merge candidate may have a fixed value. For example, thereference picture index of the temporal merge candidate may be set to‘0’.

Thereafter, a merge candidate list including the spatial merge candidateand the temporal merge candidate may be generated S2530. If the numberof merge candidates included in the merge candidate list is less than amaximum number of merge candidates, a combined merge candidate generatedby combining two or more merge candidates or a merge candidate having azero motion vector (0, 0) may be included in the merge candidate list.

When the merge candidate list is generated, at least one of mergecandidates included in the merge candidate list may be specified basedon a merge candidate index S2540.

Motion information of the current block may be set to be the same asmotion information of a merge candidate specified by the merge candidateindex S2550. For example, when the spatial merge candidate is selectedby the merge candidate index, the motion information of the currentblock may be set to be the same as the motion information of the spatialneighboring block. Alternatively, when the temporal merge candidate isselected by the merge candidate index, the motion information of thecurrent block may be set to be the same as the motion information of thetemporal neighboring block.

On the other hand, with reference to FIG. 26 , a case in which the AMVPmode is applied to the current block will be described. From thebitstream, at least one of an inter prediction direction or a referencepicture index of the current block may be decoded S2610. That is, whenthe AMVP mode is applied, at least one of the inter prediction directionor the reference picture index of the current block may be determinedbased on information encoded in the bitstream.

A spatial motion vector candidate may be determined based on a motionvector of a spatial neighboring block of the current block S2620. Thespatial motion vector candidate may include at least one of a firstspatial motion vector candidate derived from a top neighboring block ofthe current block and a second spatial motion vector candidate derivedfrom a left neighboring block of the current block. Here, the topneighboring block may include at least one of blocks adjacent to a topor top right corner of the current block, and the left neighboring blockof the current block may include at least one of blocks adjacent to aleft or bottom left corner of the current block. The block adjacent tothe top left corner of the current block may be treated as the topneighboring block, or may be treated as the left neighboring block.

If a reference picture of the current block and a reference picture ofthe spatial neighboring block are different, a spatial motion vector maybe obtained by scaling the motion vector of the spatial neighboringblock.

A temporal motion vector candidate may be determined based on a motionvector of a temporal neighboring block of the current block S2630. If areference picture of the current block and a reference picture of thetemporal neighboring block are different, a temporal motion vector maybe obtained by scaling the motion vector of the temporal neighboringblock.

A motion vector candidate list including the spatial motion vectorcandidate and the temporal motion vector candidate may be generatedS2640.

When the motion vector candidate list is generated, at least one ofmotion vector candidates included in the motion vector candidate listmay be specified based on information specifying at least one of motionvector candidate lists S2650.

The motion vector candidate specified by the information may be set as amotion vector prediction value of the current block, and then a motionvector difference value is added to the motion vector prediction valueto obtain a motion vector of the current block S2660. In this case, themotion vector difference value may be parsed from the bitstream.

Referring back to FIG. 24 , when motion information of the current blockis obtained, motion compensation for the current block may be performedbased on the obtained motion information S2420. Specifically, motioncompensation for the current block may be performed based on the interprediction direction, the reference picture index, and the motion vectorof the current block.

As in the above example, based on the motion information of the currentblock, motion compensation for the current block may be performed. Inthis case, the motion vector may have a precision (or resolution) of aninteger pixel unit or a decimal pixel unit.

The integer pixel unit may include N integer pel such as an integer pel,two integer-pel, four integer-pel, and the like. Here, N is a naturalnumber of 1 or more, in particular, it may be represented by anexponential power of 2. The integer pel may represent a precision of onepixel (i.e., one pixel unit), the two integer-pel may represent aprecision of two pixels (i.e. two pixels unit), and the four integer-pelmay represent a precision of four pixels (i.e. four pixels unit).According to the selected integer pel, a motion vector may be expressedin units of N pixels, and motion compensation may be performed in unitsof N pixels.

The decimal pixel unit may include 1/N pel such as half-pel,quarter-pel, octo-pel, and the like. Here, N is a natural number of 1 ormore, in particular, it may be represented by an exponential power of 2.The half pel may represent a precision of ½ pixel (i.e., ½ pixel unit),the quarter pel may represent a precision of ¼ pixel (i.e., ¼ pixelunit), and the octo pel may represent a precision of ⅛ pixel (i.e., ⅛pixel unit). According to the selected decimal pel, a motion vector maybe expressed in units of 1/N pixel, and motion compensation may beperformed in units of 1/N pixel.

FIGS. 27 and 28 are diagrams illustrating a motion vector derivationmethod according to a motion vector precision of a current block. FIG.27 illustrates a motion vector derivation method under an AMVP mode, andFIG. 28 illustrates a motion vector derivation method under a mergemode.

First, a motion vector precision of the current block may be determinedS2710, S2810.

A motion vector precision may be determined in a unit of a sequence, apicture, a slice or a block. Here, the block may indicate a CTU, a CU, aPU, or a block having a predetermined size/shape. The CTU may mean a CUhaving a maximum size allowed by the encoder/decoder. When a motionvector precision is determined at a higher level than a block such as asequence, a picture, or a slice, motion compensation for the block maybe performed according to the motion vector precision determined at thehigher level. For example, motion compensation for blocks included in afirst slice is performed using motion vectors in an integer-pel unit,while motion compensation for blocks included in a second slice isperformed using motion vectors in a quarter-pel unit.

To determine the precision of motion vector, information for determiningthe precision of motion vector may be signaled via the bitstream. Theinformation may be index information ‘mv_resolution_idx’ for identifyingat least one of a plurality of motion vector precisions. For example,Table 5 shows motion vector precisions according to my_resolution_idx.

TABLE 5 mv_resolution_idx Motion vector pixel unit 0 Quarter pel pixelunit 1 Half pexl pixel unit 2 Integer-pel pixel unit 3 Octo pel pixelunit 4 Two integer-pel pixel unit 5 Four integer-pel pixel unit

Table 5 is merely an example to which the present invention can beapplied. Types and/or number of motion vector precision candidates thatmay have in a predetermined unit may be different from those shown inTable 5. Values and/or range of my_resolution_idx may also differdepending on types and/or number of motion vector precision candidates.As another example, a motion vector precision may be derived from a unitspatially or temporally adjacent to a predetermined unit. Here, thepredetermined unit may indicate a picture, a slice, a block, or thelike, and the adjacent unit may indicate a picture, a slice, a block, orthe like that is spatially or temporally neighbored to the predeterminedunit. For example, a motion vector precision of the current block may beset equal to a motion vector precision of a block indicated by indexinformation among a spatial neighboring block and/or temporalneighboring block of the current block.

As another example, a motion vector precision of the current block maybe adaptively determined according to motion information of the currentblock. For example, a motion vector precision of the current block maybe determined adaptively depending on whether a temporal order or outputorder (POC) of the reference picture of the current block precedes atemporal order or output order (POC) of the current picture, whether atemporal order or output order of the reference picture of the currentblock is later than a temporal order or output order (POC) of thecurrent picture, or whether a reference picture of the current block isthe current picture.

A part of a plurality of motion vector precision candidates may beselectively used. For example, after defining a motion vector precisionset including at least one motion vector precision candidate, at leastone of motion vector precision candidates included in the motion vectorprecision set may be determined as a motion vector precision.

The motion vector precision set may be determined in a unit of asequence, a slice or a block. Motion vector precision candidatesincluded in the motion vector precision set may be predefined in theencoder and the decoder. Alternatively, the motion vector precision setmay be determined based on encoding information signaled through thebitstream. Here, the encoding information may be related to at least oneof a type and/or number of motion vector precision candidates includedin the motion vector precision set. As another example, the motionvector precision set may be derived from a unit spatially or temporallyadjacent to a predetermined unit. Here, the predetermined unit mayindicate a picture, a slice, a block, or the like, and the adjacent unitmay indicate a picture, a slice, a block, or the like that is spatiallyor temporally neighbored to the predetermined unit. For example, amotion vector precision set of a predetermined slice may be set equal toa motion vector precision set of a slice spatially adjacent to theslice. Alternatively, depending on dependency between slices, a motionvector precision set of an independent slice may be set to a motionvector precision set of a dependent slice.

Once the motion vector precision set is determined, at least one motionvector precision candidate included in the motion vector precision setmay be determined as a motion vector precision. To this end, indexinformation identifying at least one of motion vector precisioncandidates included in the motion vector precision set may be signaledthrough the bitstream. For example, a candidate identified by indexinformation among motion vector precision candidates included in themotion vector precision set may be set as a motion vector precision ofthe current block.

Whether to use a motion vector precision set may be adaptivelydetermined according to a slice type, a size/shape of the current block,motion information of the current block (e.g., a reference picture ofthe current block or a prediction direction of the current block), orthe like. Alternatively, information (e.g., a flag) indicating whether amotion vector precision set is used may be signaled via the bitstream.

When a motion vector precision set is determined at a higher level thana block such as a sequence, a picture, or a slice, a motion vectorprecision of a predetermined block may be derived from a motion vectorprecision set determined at the higher level. For example, if a motionvector set including a quarter pel and two integer-pel is defined at apicture level, blocks included in that picture may be restricted to useat least one of the quarter pel or two integer-pel.

When multi-directional prediction is applied to the current block, aplurality of motion vectors according to the multi-directionalprediction may have different motion vector precisions. That is, aprecision of any one of a plurality of motion vectors of the currentblock may be different from a precision of another motion vector. Forexample, when Bi-Prediction is applied to the current block, a precisionof a forward motion vector mvL0 may be different from a precision of abackward motion vector mvL1. Even when a prediction with more than threedirections is applied to the current block, at least one of a pluralityof motion vectors may have a precision different from another motionvector. Accordingly, information for determining a motion vectorprecision can be encoded/decoded for each prediction direction of thecurrent block.

When an AMVP mode is applied to the current block and a motion vectorprecision is variably determined for each block, there may be occurredthat a motion vector precision of a motion vector prediction value(Motion Vector Predictor, MVP) derived from a neighboring block isdifferent from a motion vector precision of the current block. In orderto match the motion vector precision of the motion vector predictionvalue to the motion vector precision of the current block, the motionvector prediction value may be scaled according to the motion vectorprecision of the current block S2720. The motion vector prediction valuemay be scaled to match it with the motion vector precision of thecurrent block. A motion vector difference value (MVD) may be added tothe scaled motion vector prediction value to derive a motion vector ofthe current block S2730.

For example, when a motion vector pixel unit of a neighboring block is aquarter pel and a motion vector pixel unit of the current block is aninteger pel, the motion vector prediction value derived from theneighboring block may be scaled in the integer pel unit, and then amotion vector in the integer pel unit may be obtained by adding thescaled motion vector prediction value and the motion vector differencevalue. For example, Equation 1 below shows an example in which a motionvector is obtained by scaling a motion vector prediction value in aninteger pel unit.mvLX[0]=((mvpLX[0]>>2)+mvdLX[0]<<2mvLX[1]=((mvpLX[1]>>2)+mvdLX[1]<<2  [Equation 1]

In the Equation 1, mvpLX represents a motion vector prediction value,and mvdLX represents a motion vector difference value. In addition,mvLX[0], mvpLX[0], and mvdLX[0] represent motion vector components in avertical direction, and mvLX[1], mvpLX[1], and mvdLX[1] represent motionvector components in a horizontal direction.

As another example, when a motion vector pixel unit of a neighboringblock is two integer-pel and a motion vector pixel unit of the currentblock is a quarter pel, a motion vector prediction value derived fromthe neighboring block may be scaled in the quarter pel unit, and amotion vector in the quarter pel unit may be obtained by adding thescaled motion vector prediction value and a motion vector differencevalue. For example, Equation 2 below shows an example in which a motionvector is obtained when a current picture is used as a referencepicture.mvLX[0]=(mvpLX[0]>>3+mvdLX[0])<<3mvLX[1]=(mvpLX[1]>>3+mvdLX[1])<<3  [Equation 2]

In Equations 1 and 2, a bit shift value used to scale the motion vectorprediction value may be adaptively determined according to amagnification between a motion vector precision of the current block anda motion vector precision of the neighboring block.

Unlike the example shown in FIG. 27 , it is also possible to scale amotion vector generated by adding a motion vector prediction value and amotion vector difference value, to match it with a motion vectorprecision of the current block.

A motion vector difference value may be encoded/decoded according to amotion vector precision of the current block. For example, when themotion vector precision of the current block is a quarter pel, themotion vector difference value for the current block may beencoded/decoded in a quarter pel unit.

It is also possible to encode/decode a motion vector difference value ina predetermined unit regardless of a motion vector precision of thecurrent block. Here, the predetermined unit may be a fixed pixel unit(for example, an integer pel or a quarter pel) that is previouslypromised by the encoder and the decoder, or a pixel unit that isdetermined at a higher level such as a picture or a slice. If a motionvector precision of the current block and a motion vector precision ofthe motion vector difference are different, a motion vector of thecurrent block may be derived by scaling a motion vector differencevalue, or by scaling a motion vector derived by adding a scaled motionvector prediction value and a motion vector difference value. Forexample, if a motion vector precision of the current block is an integerpel, while a motion vector difference value is in a quarter pelprecision, a motion vector of the current block may be derived byscaling a motion vector derived by adding a scaled motion vectorprediction value and a motion vector difference value, as shown inEquation 1.

According to a motion vector precision, a method of encoding/decoding amotion vector difference value may be differently determined. Forexample, in the case of a decimal pel pixel unit, a motion vector prefixpart may represent an integer part of a motion vector, and a suffix partmay represent a fractional part of the motion vector. For example,Equation 3 below shows an example of deriving a prefix part‘predfix_mvd’ and a suffix part ‘suffix_mvd’.prefix_mvd=MVD/Nsuffix_mvd=MVD % N  [Equation 3]

In Equation 3, N may be a fixed value or may be a value variablydetermined according to a motion vector precision of the current block.For example, N may be a value in proportion to a motion vector precisionof the current block.

When a motion vector precision of the current block is two or moreinteger-pel unit, a value obtained by shifting a motion vectordifference value by N may be encoded. For example, if a motion vectorprecision of the current block is two-integer pel, ½ of the motionvector difference value may be encoded/decoded. If a motion vectorprecision of the current block is 4 integer-pel, ¼ of the motion vectordifference value may be encoded/decoded. In this case, the decoder mayderive the motion vector of the current block by scaling the decodedmotion vector difference value according to the motion vector precisionof the current block.

When a merge mode or a skip mode is applied to the current block and amotion vector precision is variably determined for each block, there maybe occurred that a motion vector precision of a spatial/temporal mergecandidate block is different from a motion vector precision of thecurrent block. Accordingly, a motion vector of the spatial/temporalneighboring block may be scaled according to the motion vector precisionof the current block S2820, and the scaled motion vector may be set asthe motion information of the spatial/temporal merge candidate S2830.For example, a scaled motion vector mxLXscale[0] and/or mvLXscale[1] isderived by scaling a motion vector mvLX[0] and/or mvLX[1] of aspatial/temporal neighboring block, and then the scaled motion vectormay be set as a motion vector of the spatial/temporal merge candidate.

For example, when a motion vector precision of a neighboring blockadjacent to the current block is a quarter pel and a motion vectorprecision of the current block is an integer pel, a motion vector of aspatial neighboring candidate is set by scaling the motion vector of theneighboring block as shown in Equation 4 below.mvLXscale[0]=(mvLX[0]>>2)<<2mvLXscale[1]=(mvLX[1]>>2)<<2  [Equation 4]

In Equation 4, a bit shift value used to scale a motion vector of aneighboring block may be adaptively determined according to amagnification between a motion vector precision of the current block anda motion vector precision of the neighboring block.

As another example, a merge candidate (i.e., a merge candidate selectedby a merge index) to be merged with the current block may be selected,and it may be checked whether a motion vector precision of itcorresponds to a motion vector precision of the current block. When themotion vector precision of the selected merge candidate does not matchwith the motion vector precision of the current block, the motion vectorof the selected merge candidate may be scaled according to the motionvector precision of the current block.

A motion vector of the current block may be set to be the same as amotion vector (i.e., the scaled motion vector) of a merge candidateselected by index information among merge candidates S2840.

Unlike the example shown in FIG. 28 , a merge candidate for the currentblock may be determined in consideration of a motion vector precision ofa spatial/temporal neighboring block. For example, based on adetermination of whether a difference or magnification between a motionvector precision of the spatial neighboring block and a motion vectorprecision of the current block is greater than or equal to apredetermined threshold value, it may be determined whether thespatial/temporal neighboring block can be used as a merge candidate. Forexample, when the motion vector precision of the spatial merge candidateis two integer-pel and the motion vector precision of the current blockis a quarter pel, this may mean that a correlation between two blocks isnot huge. Accordingly, the spatial/temporal neighboring block whose adifference or magnification with the motion vector precision of thecurrent block is larger than a threshold value may be set as unavailableas a merge candidate. That is, the spatial/temporal neighboring blockcan be used as a merge candidate only when a difference between themotion vector precision of the spatial/temporal neighboring block andthe motion vector precision of the current block is less than or equalto the threshold value. The spatial/temporal neighboring block thatcannot be referred to as a merge candidate may not be added to a mergecandidate list.

When a difference or magnification between a motion vector precision ofthe current block and a motion vector precision of a neighboring blockis equal to or less than a threshold value but both precisions aredifferent, a scaled motion vector may be set as a motion vector of amerge candidate or a motion vector of the merge candidate specified by amerge index may be scaled as in the embodiment described above withreference to FIG. 28 .

A motion vector of the current block may be derived from a motion vectorof a merge candidate added to a merge candidate list. If a motion vectorprecision of the current block and a motion vector precision of themerge candidate added to the merge candidate list are different, amotion vector precision difference value may indicate a differencebetween motion vector precisions, or may indicate a difference valuebetween corresponding values corresponding to motion vector precisions.Here, the corresponding value may indicate an index value correspondingto a motion vector precision as illustrated in Table 5, or may indicatea value assigned to each motion vector precision as illustrated in Table6. For example, in Table 6, since a corresponding value assigned to aquarter pel is 2 and a corresponding value assigned to an integer pel is3, the difference value of both precisions may be determined as 2.

TABLE 6 Motion vector precision unit Corresponding value Octo pel pixelunit 0 Quarter pel pixel unit 1 Half pel pixel unit 2 Integer pel pixelunit 3 Two integer-pel pixel unit 4 Four integer-pel pixel unit 5

Availability of a temporal spatial neighboring block may be determinedby using a motion vector precision magnification instead of a motionvector precision difference value. Here, the motion vector precisionmagnification may represent a ratio between both motion vectorprecisions. For example, a magnification between a quarter pel and aninteger pel may be defined as 4. FIGS. 29 and 30 are diagrams forexplaining a method of deriving a temporal motion vector (temporal MV)in a plurality of motion vector units.

A motion vector used in a previous picture may be used as a motionvector candidate in a merge mode or an advanced motion vector predictor(AMVP) mode. For this purpose, a motion vector may be stored in a unitof N×M size. A motion vector derived from a pre-defined region of N×Msize is referred to as a temporal representative motion vector. Thetemporal representative motion vector may be used as a temporal MV ofanother picture.

Here, N and M may be a constant of 4, 8, 16, 32 or more, and N and M maybe the same or may be different from each other. The N×M size may be afixed value applied to the entire video sequence or may be differentlydefined for each unit of a picture, slice, tile, or the like. To thisend, the encoder can determine an optimal N×M size and encode it. Whenthere are a plurality of motion vectors within a pre-defined area unit,all of motion vectors may be stored, or only a part of them may beselectively stored. One of all motion vectors may be stored as arepresentative motion vector, and the representative motion vector maybe a motion vector of a block located at a left-top corner within thepre-defined area unit. However, the present invention is not limitedthereto, and the representative motion vector may be a motion vector ofa right-top corner block, a left-bottom corner block, a right-bottomcorner block, or a block including a center position. Here, thepre-defined area unit is referred to as a motion vector storage basicblock.

As shown in FIG. 29 , a motion vector of a prediction unit whichcomprises a top left sample or a motion vector of a coding unit may bestored as a representative motion vector. A size of a motion vectorstorage basic unit may be selectively used based on a sequence, pictureor slice. For example, a motion vector storage basic block of 16×16 sizemay be used in a picture 0 (a picture whose picture order count (POC)value is 0), and a motion vector storage basic block of 32×32 size maybe used in a picture 1 (a picture whose picture order count (POC) valueis 1).

When deriving a representative motion vector from a motion vectorstorage basic unit, the representative motion vector may be derivedbased on a precision of a motion vector. For example, if there arevarious motion vector precisions within a motion vector storage basicblock as shown in FIG. 30 , a motion vector having a most accurateprecision (¼ pel is more accurate than ½ pel) may be derived as arepresentative motion vector.

On the contrary, it is also possible that a motion vector having a leastaccurate precision (½ pel is less accurate than ¼ pel) may be derived asa representative motion vector. Alternatively, a motion vector of ablock having the same motion vector precision as the current CU may bederived as a representative motion vector.

Alternatively, regardless of a motion vector precision of the currentCU, only certain motion vector precision previously promised in theencoder/decoder may be used. For example, if the encoder/decoder ispromised to store a motion vector with ¼ pel precision as arepresentative motion vector, a motion vector having ¼ pel precisionamong a plurality of motion vector precisions included in a motionvector storage basic block may be stored as a representative motionvector. If there are a plurality of motion vectors with ¼ pel precision,storing a representative motion vector may be performed based on apredetermined priority or scanning order.

That is, as described above, a representative motion vector may bestored in consideration of at least one of a position of a block or amotion vector precision in a motion vector storage basic block.

Specifically, for example, as illustrated in FIG. 30 , when two codingunits CU0 and CU1 included in a top left motion vector storage basicblock of 16×16 size have different motion vector precisions, arepresentative motion vector may be used in consideration of the motionvector precisions of respective coding units. For example, if CU0 has 4integer-pel pixel unit and CU1 has a quarter pel pixel unit, a motionvector derived from a sample at a top left of CU1 who has a moreaccurate motion vector precision may be derived as a representativemotion vector. That is, it means that a representative motion vector isdetermined by comparing motion vector precisions of each coding unit ina motion vector storage basic unit rather than deriving a motion vectorderived by a top-left sample of the motion vector storage basic unit asthe representative motion vector.

In addition, for example, in a 16×16 motion vector storage basic blockincluding CU2, CU3, CU4 and CU5, a motion vector derived from a top leftsample of CU5 which has a motion vector of a most accurate precision maybe set as a representative motion vector. For example, when CU2 and CU3has an integer pel pixel unit, CU4 has a half pel pixel unit, and CU5has a quarter pel pixel unit, a motion vector derived by a top leftsample of CU5 who has the most accurate motion vector precision may bederived as a representative motion vector.

Similarly, for example, in a 16×16 motion vector storage basic blockincluding CU6, and CU7, a motion vector derived from a top left sampleof CU6 who has a motion vector of a most accurate precision may be setas a representative motion vector.

On the contrary, it is also possible to set a motion vector who has aleast accurate precision in a motion vector storage base block asrepresentative motion vector. In this case, in the above example, CU0,CU2 (or CU3) and CU7 can be respectively set as a representative motionvector.

FIG. 31 illustrates, as another embodiment to which the presentinvention is applied, a syntax element included in a network abstractlayer (NAL) applied to an intra prediction sample interpolation. The NALunit to which the present invention is applied may include, for example,a video parameter set (VPS), a sequence parameter set (SPS), a pictureparameter set (PPS), and at least one slice set (Slice).

For example, it is illustrated in FIG. 31 that a syntax element includedin a slice set (SPS), but it is also possible to a sequence parameterset (SPS) or a picture parameter set (PPS) to include the syntaxelement. In addition, a syntax element to be commonly applied tosequence units or a picture unit may be included in a sequence parameterset (SPS) or a picture parameter set (PPS). On the other hand, a syntaxelement that is applied only to the slice is preferably included in aslice set (Slice). Therefore, this can be selected in consideration ofencoding performance and efficiency.

A syntax element ‘CU_partitioning’ is information indicating a type of apartitioned coding unit. For example, ‘CU_partitioning’ may have apredefined codeword value, as shown in Table 3 or Table 4.

In addition, a syntax element ‘CU_merge_flag’ is information indicatingwhether a merge between adjacent coding units has been occurred. Forexample, when ‘CU_merge_flag=1’, it may be defined as a coding unit inwhich merge occurs, and when ‘CU_merge_flag=0’, it may be defined as anormal coding unit in which no merge occurs.

In addition, a syntax element ‘CU_merge_idx’ is information indicating ashape in which merge occurs in a merge coding unit. That is, forexample, if ‘CU_merge_idx=0’, it may be defined that first two codingunits in a coding order are merged, and if ‘CU_merge_idx=1’, it may bedefined that last two coding units in a coding order are merged. Inaddition, according to the definition between the encoder-decoder, itcan be defined that last two coding units in coding order are mergedwhen ‘CU_merge_idx=2’.

In addition, a syntax element ‘mv_resolution_idx’ is index informationindicating a precision of a motion vector. For example, a index value of‘mv_resolution_idx’ may be defined as shown in Table 5.

Although the above-described embodiments have been described on thebasis of a series of steps or flowcharts, they do not limit thetime-series order of the invention, and may be performed simultaneouslyor in different orders as necessary. Further, each of the components(for example, units, modules, etc.) constituting the block diagram inthe above-described embodiments may be implemented by a hardware deviceor software, and a plurality of components. Or a plurality of componentsmay be combined and implemented by a single hardware device or software.The above-described embodiments may be implemented in the form ofprogram instructions that may be executed through various computercomponents and recorded in a computer-readable recording medium. Thecomputer-readable recording medium may include one of or combination ofprogram commands, data files, data structures, and the like. Examples ofcomputer-readable media include magnetic media such as hard disks,floppy disks and magnetic tape, optical recording media such as CD-ROMsand DVDs, magneto-optical media such as floptical disks, media, andhardware devices specifically configured to store and execute programinstructions such as ROM, RAM, flash memory, and the like. The hardwaredevice may be configured to operate as one or more software modules forperforming the process according to the present invention, and viceversa.

INDUSTRIAL APPLICABILITY

The present invention may be applied to electronic devices which is ableto encode/decode a video.

The invention claimed is:
 1. A method of decoding a video, the methodcomprising: performing inter-prediction for a current coding block basedon motion information thereof, determining, based on a first flag of1-bit, whether to divide the current coding block into two partitions ornot; when it is determined to divide the current coding block,determining, based on a second flag of 1-bit, whether to divide thecurrent coding block symmetrically or asymmetrically; and determining,based on a third flag of 1-bit, whether to divide the current codingblock in a horizontal direction or a vertical direction, wherein when itis determined to divide the current coding block asymmetrically, thecurrent coding block is partitioned into a first partition that has a ¾size of the current coding block and a second partition that has a ¼size of the current coding block, and wherein locations of the firstpartition and the second partition in the current coding block aredetermined based on a fourth flag of 1-bit.
 2. The method of claim 1,wherein when it is determined to divide the current coding block in thehorizontal direction, based on the fourth flag, it is determined whetherthe first partition is located at an upper side or a bottom side of thecurrent coding block, and wherein when it is determined to divide thecurrent coding block in the vertical direction, based on the fourthflag, it is determined whether the first partition is located at a leftside or a right side of the current coding block.
 3. The method of claim1, wherein when it is determined to divide the current coding block intothe two partitions, decoding a transform skip flag specifying whether aninverse-transform is skipped or not is omitted.
 4. The method of claim3, wherein when decoding the transform skip flag is omitted, skippingthe inverse-transform for the first partition or the second partition isnot allowed.
 5. A method of encoding a video, the method comprising:performing inter-prediction for a current coding block based on motioninformation thereof, encoding a first flag of 1-bit specifying whetherthe current coding block is divided into two partitions or not; when thecurrent coding block is divided into two partitions, encoding a secondflag of 1-bit specifying whether the current coding block is dividedsymmetrically or asymmetrically; and encoding a third flag of 1-bitspecifying whether the current coding block is divided in a horizontaldirection or a vertical direction, wherein when the current coding blockis divided asymmetrically, the current coding block is partitioned intoa first partition that has a ¾ size of the current coding block and asecond partition that has a ¼ size of the current coding block, andwherein a fourth flag of 1-bit which is used to determine locations ofthe first partition and the second partition in the current coding blockis further encoded.
 6. The method of claim 5, wherein when the currentcoding block is divided in the horizontal direction, the fourth flag isused to determine whether the first partition is located at an upperside or a bottom side of the current coding block, and wherein when thecurrent coding block is divided in the vertical direction, the fourthflag is used to determine whether the first partition is located at aleft side or a right side of the current coding block.
 7. The method ofclaim 5, wherein when the current coding block is divided into the twopartitions, encoding a transform skip flag specifying whether atransform is skipped or not is omitted.
 8. The method of claim 7,wherein when encoding the transform skip flag is omitted, skipping thetransform for the first partition or the second partition is notallowed.
 9. A non-transitory computer-readable medium for storing dataassociated with a video signal, comprising: a data stream stored in thenon-transitory computer-readable medium, the data stream being encodedby an encoding method which comprising: performing inter-prediction fora current coding block based on motion information thereof, encoding afirst flag of 1-bit specifying whether the current coding block isdivided into two partitions or not; when the current coding block isdivided into two partitions, encoding a second flag of 1-bit specifyingwhether the current coding block is divided symmetrically orasymmetrically; and encoding a third flag of 1-bit specifying whetherthe current coding block is divided in a horizontal direction or avertical direction, wherein when the current coding block is dividedasymmetrically, the current coding block is partitioned into a firstpartition that has a ¾ size of the current coding block and a secondpartition that has a ¼ size of the current coding block, and wherein afourth flag of 1-bit which is used to determine locations of the firstpartition and the second partition in the current coding block isfurther encoded.